#C11862. Nova Polynomial Integration
Nova Polynomial Integration
Nova Polynomial Integration
You are given a polynomial represented by a list of integer coefficients p
where p[i]
is the coefficient of xi. Your task is to compute the indefinite integral of this polynomial with the constant of integration set to zero. In mathematical terms, if:
\[f(x)=p_0+p_1x+p_2x^2+\cdots+p_{n-1}x^{n-1}\]
then the integral is:
\[\int f(x)\,dx = 0+\frac{p_0}{1}x+\frac{p_1}{2}x^2+\frac{p_2}{3}x^3+\cdots+\frac{p_{n-1}}{n}x^n\]
You are guaranteed that each division \(\frac{p_i}{i+1}\) results in an integer.
inputFormat
The input is read from the standard input (stdin). The first line contains a single integer n
representing the number of coefficients of the polynomial. The second line contains n
space-separated integers, where the ith
number is p[i]
, the coefficient for \(x^i\).
outputFormat
The output should be written to the standard output (stdout) as n+1
space-separated integers representing the coefficients of the integrated polynomial. The first coefficient is always 0
(the constant of integration), and the \((i+1)th\) coefficient is \(\frac{p[i]}{i+1}\).
1
2
0 2
</p>