luogu#P5139. z小f的函数
z小f的函数
Background
z Xiao f loves mathematics.
Because z Xiao f needs to review for NOIp, and he thinks the math homework is too easy, he handed the math homework to you.
Problem Description
Given a quadratic function , perform the following operations on the function:
- Operation 1: Given a coefficient , shift the function upward by units (if , shift downward by units).
- Operation 2: Given a coefficient , shift the function rightward by units (if , shift leftward by units).
- Operation 3: Given coefficients , perform a symmetry transformation of the function with respect to the point .
- Operation 4: Given coefficients , find the minimum and maximum values of the function on the closed interval .
- Operation 5: Given coefficients , determine whether the quadratic function intersects with the quadratic function .
In addition, you must output the maximum (or minimum) value of the final quadratic function at that time.
Input Format
The first line contains a positive integer , indicating the number of math homework problems (i.e., the number of test cases).
Then follow test cases. For each test case:
The first line contains three numbers , representing the coefficients of the quadratic function.
The second line contains a positive integer , representing the number of operations.
The next lines: each line starts with an integer , indicating the operation number, and the following numbers are the parameters of the operation (see the Description).
The testdata is guaranteed to be valid.
Output Format
For each Operation 4, output two decimal numbers, representing the minimum and maximum values on the interval (keep two decimal places).
For each Operation 5, output one integer, where means there is no intersection point, and means there is an intersection point.
After completing all operations of each test case, output the maximum (or minimum) value of the final quadratic function at that time (keep two decimal places).
1
1 0 0
4
1 3
1 -4
4 1 2
5 -1 0 -3
0.00 3.00
0
-1.00
1
-4 10 100
15
4 0 78
5 -4 -95 -97
1 -79
4 12 54
4 -60 11
1 83
4 68 80
2 -63
1 71
1 80
3 12 67
1 60
1 41
3 35 -13
4 6 26
-23456.00 106.25
2
-11103.00 -435.00
-14979.00 27.25
-24696.00 -17712.00
-6972.00 -1892.00
0.25
Hint
For of the testdata, , and there is no Operation 3.
For of the testdata, .
For of the testdata, , .
The testdata guarantees $a\ne0,u\ne0,a\ne u,1\le p\le5,-100\le a,b,c,k1,k2,k,u,v,w\le100$.
Translated by ChatGPT 5