A-Polinom
You are given an equation An * X^n + An-1 * X^(n-1) + ... + A2 * X^2 + A1 * X + A0 = 0.
Let X1, X2,..., Xn be the solutions of this equation.
Your task is to find the value of
X1^2 + X2^2 +...+ Xn^2 .
InputIn the first line of input there is one integer n ( 0 < n < 100 ), that
represents the degree of the equation.
In the next n+1 lines there are numbers
An, An-1, An-2,..., A2, A1, A0 ( 0<Ai<100 ),
coefficient of the equation.
represents the degree of the equation.
In the next n+1 lines there are numbers
An, An-1, An-2,..., A2, A1, A0 ( 0<Ai<100 ),
coefficient of the equation.
OutputTo the standard output, print a single floating-point number with a precision of 2 decimals,
the required value.
the required value.
Input:
Output:
2
1
2
1
Output:
2.00
Explanation: the equation is X^2 + 2*X + 1=0.
The solutions of this equation are X1=-1 and X2=-1.
X1^2 + X2^2=2.00
Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.