#t209. 计算多项式的值

计算多项式的值

Evaluate a Polynomial

Problem Background

Special for beginners, ^_^

Problem Description

For the polynomial f(x)=ax3+bx2+cx+df(x)=ax^3+bx^2+cx+d and given a,b,c,d,xa, b, c, d, x, compute the value of f(x)f(x).

Input Format

A single line containing 55 real numbers: xx, and the values of the parameters a,b,c,da, b, c, d. Each number is a double-precision floating-point number with absolute value not exceeding 100100. The numbers are separated by a single space.

Output Format

A single real number, the value of f(x)f(x), kept to 7 decimal places.

Sample Input

2.31 1.2 2 2 3

Sample Output

33.0838692

Constraints

Time limit: 1s, memory limit: 1024KiB for each test case.

Hint

  • The five numbers on one line are all real numbers, and the first one is xx — do not reverse the reading order.
  • Plug into the formula in the statement and keep 7 decimal places.
  • Verify with the sample: 2.31 1.2 2 2 3 → 33.0838692.