#P6414. [COCI 2014/2015 #1] PROSJEK

[COCI 2014/2015 #1] PROSJEK

Description

There is a sequence aa. Now define a sequence bb by the following formula:

bi=j=1iajib_i=\frac{ \sum^i_{j=1} a_j }{i}

You are given the sequence bb. Please find the sequence aa.

Input Format

The first line contains an integer nn, which is the length of the sequence bb.

The next line contains nn integers, representing the sequence bb.

Output Format

Output one line with nn integers, representing the sequence aa.

1
2
2
4
3 2 3 5
3 1 5 11
5
1 2 2 3 4
1 3 2 6 8

Hint

Sample Input/Output 3 Explanation

When the sequence a=1,3,2,6,8a=1,3,2,6,8, the sequence $b=\frac{1}{1},\frac{1+3}{2},\frac{1+3+2}{3},\frac{1+3+2+6}{4},\frac{1+3+2+6+8}{5}$, that is, b=1,2,2,3,4b=1,2,2,3,4.

Constraints

For 100%100\% of the testdata, it is guaranteed that 1n1001\le n\le 100 and 1ai,bi1091\le a_i,b_i\le 10^9.

Notes

The total score of this problem is 5050 points.

This problem is translated from T1 PROSJEK of Contest #1 in Croatian Open Competition in Informatics 2014/2015.

Translated by ChatGPT 5