#C10201. Polynomial Derivative

    ID: 39381 Type: Default 1000ms 256MiB

Polynomial Derivative

Polynomial Derivative

You are given a polynomial represented by a list of its coefficients. The coefficient at index i corresponds to the term \(a_i x^i\). Your task is to compute the derivative of the polynomial.

If \(P(x)=\sum_{i=0}^{n-1}a_i x^i\), then its derivative is \(P'(x)=\sum_{i=1}^{n-1}i\,a_i x^{i-1}\). Note that the derivative of a constant (a polynomial of degree 0) is defined here to be 0.

For example:

Input:  3
       3 5 2
Output: 5 4

Input: 4 1 3 0 7 Output: 3 0 21

</p>

The input is read from standard input and the output should be written to standard output.

inputFormat

The first line contains an integer \(n\) which indicates the number of coefficients of the polynomial. The second line contains \(n\) space-separated integers representing the coefficients \(a_0, a_1, \ldots, a_{n-1}\) of the polynomial \(P(x)\).

outputFormat

Output a line with the coefficients of the derivative polynomial, separated by a single space. If the derivative is the zero polynomial (i.e. the input polynomial is a constant), output a single 0.

## sample
3
3 5 2
5 4