#P712A. Memory and Crow
Memory and Crow
Memory and Crow
题面翻译
有个数
是通过等式 = 得到的
现给你这n个数,问是多少
Translated by @@AC我最萌
题目描述
There are integers written in a row. For all from to , values are defined by the crows performing the following procedure:
- The crow sets initially .
- The crow then adds to , subtracts , adds the number, and so on until the 'th number. Thus, .
Memory gives you the values , and he now wants you to find the initial numbers written in the row? Can you do it?
输入格式
The first line of the input contains a single integer ( ) — the number of integers written in the row.
The next line contains , the 'th of which is ( ) — the value of the 'th number.
输出格式
Print integers corresponding to the sequence . It's guaranteed that the answer is unique and fits in 32-bit integer type.
样例 #1
样例输入 #1
5
6 -4 8 -2 3
样例输出 #1
2 4 6 1 3
样例 #2
样例输入 #2
5
3 -2 -1 5 6
样例输出 #2
1 -3 4 11 6
提示
In the first sample test, the crows report the numbers , , , , and when he starts at indices , , , and respectively. It is easy to check that the sequence satisfies the reports. For example, , and .
In the second sample test, the sequence , , , , satisfies the reports. For example, and .