#P6863. [RC-03] 上下求索
[RC-03] 上下求索
Description
There is an -variable quadratic equation about :
$$\sum_{i=1}^na_ix_i^2+\sum_{i=1}^{n-1}b_ix_ix_{i+1}=m$$In this equation, please find the range of values of that guarantees the equation has at least one solution.
It is guaranteed that has both a lower bound and an upper bound.
Input Format
The input has three lines.
The first line contains two integers .
The second line contains integers , where .
The third line contains integers , where .
Output Format
Output one line with two integers separated by a space, representing the lower bound and upper bound of (it is guaranteed that the output is always integers).
5 16
2 2 2 2 1
2 2 2 2
-4 4
Hint
[Sample Explanation]
The original equation is $2x_1^2+2x_1x_2+2x_2^2+2x_2x_3+2x_3^2+2x_3x_4+2x_4^2+2x_4x_5+x_5^2=16$.
When , we have ; ; ; ; .
When , we have ; ; ; ; .
When or , the left-hand side of the original equation must be .
Therefore, .
[Constraints]
For of the testdata, .
For of the testdata, .
For another of the testdata, , .
For of the testdata, .
For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号