题目描述
As everyone knows, the Newton method is an effective way to solve the polynomial ,which follows the basic iterative process below:
Xk+1 = Xk - f(xk)/f'(xk)
Xk+1 means the value of x at the k+1 step;
Xk means the value of x at the k step;
f(x) means the value of polynomial;
f'(x) means the Derivative of f at x.
输入
There are multiple test cases, each line is a test case.
Each test case begins with a number X0 and an integer N(1<=N<=10), which means the degree of the polynomial,then N+1 numbers followed called a0,a1....aN,which indicates the coefficient of X^0,X^1...X^N.
输出
Each test case should output one line. A number with three decimal.