Write a program that reads a number and a polynomial , and computes .
Input consists of a real number followed by the description of the polynomial : the real coefficients , , …, in this order. (The first sample input/output corresponds to the evaluation of at .)
Print with 4 digits after the decimal point.
The expected solution uses Horner’s rule.
Input
2 5 4 3
Output
31.0000
Input
3 10 0 0
Output
90.0000
Input
-2.5 5.4 0 -2 1
Output
-78.3750