Back
Close

Derivative of A Polynomial

Statement
You are given a polynomial represented as a list of floats [[A,B,C,...]] of length [[M]], where [[A,B,C...]] are coefficients used in the following way p(x) = [[A]] + [[B]]X + [[C]]X^2 + [[D]]X^3.... You must find the derivative with respect to X. The derivative D of a polynomial with respect to X is calculated in the following manner (letters represent constants, except for x) D (a*x^p) = a*p*x^(p-1) D (a*x^p + b*x^q + c*x^r...) = D (a*x^p) + D (b*x^q) + D (c*x^r) ... EXAMPLE DERIVATIVE: D(13.421 + 14.2X + 6X^2) = 14.2 + 12X

Input description
<<Line 1:>> An integer [[M]] for the length of the list of polynomial coefficients <<Next [[M]] lines:>> The list of polynomial coefficients starting with the coefficient on x^0 [[A]]

Output description
<<[[M]] - 1 lines:>> The list of polynomial coefficients starting with the coefficient on x^0 [[A]] rounded to the tenths place(5.1, 3.2, 19.3).

Constraints
2 ≤ [[M]] < 10 -500 ≤ [[A,B,C]]....(input polynomial) ≤ 500 -5000 ≤ [[A,B,C]]....(output polynomial) ≤ 5000

Game modes

Test cases
Zeros Test
Input
9 0 0 0 0 0 0 0 0 0
Output
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0

Validator 3 Validator
Input
5 0 0 0 0 0
Output
0.0 0.0 0.0 0.0

Mixed Sign Large Numbers Test
Input
7 -100.512 -254.1 1.3 0 -24.68 457.4223 333.33
Output
-254.1 2.6 0.0 -98.7 2287.1 2000.0

Validator 4 Validator
Input
7 -150.512 -274.1 1.84 0 -24.68 459.499 333.33
Output
-274.1 3.7 0.0 -98.7 2297.5 2000.0

Test Test
Input
5 1.2 3 -2 -4 -5
Output
3.0 -4.0 -12.0 -20.0

Validator 5 Validator
Input
6 1.2 3 -2 -4.6 -5.777 12.3
Output
3.0 -4.0 -13.8 -23.1 61.5

More Test Test
Input
5 1.2 -3.531 1.5 76 32
Output
-3.5 3.0 228.0 128.0

Validator 6 Validator
Input
6 1.2 -3.531 1.5 76 32 -93
Output
-3.5 3.0 228.0 128.0 -465.0

Solution language

Solution

Stub generator input