Write a program that reads a number *x*
and a polynomial *p*(*z*) = *c*_{0} *z*^{0} + *c*_{1} *z*^{1} + ⋯ + *c*_{n} *z*^{n},
and computes *p*(*x*).

**Input**

Input consists of a real number *x*
followed by the description of the polynomial *p*(*z*):
the real coefficients
*c*_{n}, *c*_{n−1}, …, *c*_{0} in this order.
(The first sample input/output corresponds
to the evaluation of *p*(*z*) = 3 + 4*z* + 5*z*^{2}
at *x* = 2.)

**Output**

Print *p*(*x*) with 4 digits after the decimal point.

**Hint**

The expected solution uses Horner’s rule.

Public test cases

**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

Information

- Author
- Salvador Roura
- Language
- English
- Translator
- Salvador Roura
- Original language
- Catalan
- Other languages
- Catalan
- Official solutions
- C++ Java Python
- User solutions
- C C++ Java Python