Codeforces Round 370 (Div. 2)
A
Memory and Crow
Codeforces
800
原题
←B →
翻译中…

There are $*n*$ integers $*b*_{1}, *b*_{2}, ..., *b*_{*n*}$ written in a row. For all $*i*$ from $1$ to $*n*$, values $*a*_{*i*}$ are defined by the crows performing the following procedure:

翻译中…
  • The crow sets $*a*_{*i*}$ initially $0$.
  • The crow then adds $*b*_{*i*}$ to $*a*_{*i*}$, subtracts $*b*_{*i* + 1}$, adds the $*b*_{*i* + 2}$ number, and so on until the $*n*$'th number. Thus, $*a*_{*i*} = *b*_{*i*} - *b*_{*i* + 1} + *b*_{*i* + 2} - *b*_{*i* + 3}...$.
翻译中…

Memory gives you the values $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$, and he now wants you to find the initial numbers $*b*_{1}, *b*_{2}, ..., *b*_{*n*}$ written in the row? Can you do it?

翻译中…

Input

翻译中…

The first line of the input contains a single integer $*n*$ ($2 ≤ *n* ≤ 100 000$) — the number of integers written in the row.

翻译中…

The next line contains $*n*$, the $*i*$'th of which is $*a*_{*i*}$ ($- 10^{9} ≤ *a*_{*i*} ≤ 10^{9}$) — the value of the $*i*$'th number.

翻译中…

Output

翻译中…

Print $*n*$ integers corresponding to the sequence $*b*_{1}, *b*_{2}, ..., *b*_{*n*}$. It's guaranteed that the answer is unique and fits in 32-bit integer type.

翻译中…

Note

翻译中…

In the first sample test, the crows report the numbers $6$,$- 4$, $8$,$- 2$, and $3$ when he starts at indices $1$, $2$, $3$, $4$ and $5$ respectively. It is easy to check that the sequence $2$ $4$ $6$ $1$ $3$ satisfies the reports. For example, $6 = 2 - 4 + 6 - 1 + 3$, and $- 4 = 4 - 6 + 1 - 3$.

翻译中…

In the second sample test, the sequence $1$, $- 3$, $4$, $11$, $6$ satisfies the reports. For example, $5 = 11 - 6$ and $6 = 6$.

翻译中…

样例

Input #1
5
6 -4 8 -2 3
Output #1
2 4 6 1 3
InputCopy OutputCopy
Input #2
5
3 -2 -1 5 6
Output #2
1 -3 4 11 6
InputCopy OutputCopy
题目信息
题号
712A
时间限制
2 s
内存限制
256 MB
标签
模拟
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。