Evaluate a Quartic Polynomial


Submit solution

Points: 100
Time limit: 2.0s
Memory limit: 256M

Author:
Problem types

Given real values \(x,a_0,a_1,a_2,a_3,a_4\), evaluate \(f(x)=a_0+a_1x+a_2x^2+a_3x^3+a_4x^4\).

Input

Six lines contain \(x,a_0,a_1,a_2,a_3,a_4\), in that order.

Output

Print X = A0 = A1 = A2 = A3 = A4 = f(x) = followed by \(f(x)\), formatted with at most six significant digits and no unnecessary trailing zeros.

Example

Input
1.5
2
3
4
5
6
Output
X = A0 = A1 = A2 = A3 = A4 = f(x) = 62.75

Comments

There are no comments at the moment.