P6414 [COCI 2014/2015 #1] PROSJEK

Description

There is a sequence $a$. Now define a sequence $b$ by the following formula: $$b_i=\frac{ \sum^i_{j=1} a_j }{i}$$ You are given the sequence $b$. Please find the sequence $a$.

Input Format

The first line contains an integer $n$, which is the length of the sequence $b$. The next line contains $n$ integers, representing the sequence $b$.

Output Format

Output one line with $n$ integers, representing the sequence $a$.

Explanation/Hint

#### Sample Input/Output 3 Explanation When the sequence $a=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,4$. #### Constraints For $100\%$ of the testdata, it is guaranteed that $1\le n\le 100$ and $1\le a_i,b_i\le 10^9$. #### Notes **The total score of this problem is $50$ points.** This problem is translated from T1 PROSJEK of [Contest #1](https://hsin.hr/coci/archive/2014_2015/contest1_tasks.pdf) in [Croatian Open Competition in Informatics 2014/2015](https://hsin.hr/coci/archive/2014_2015). Translated by ChatGPT 5