#882
Gold III
KEMIJA
시간 제한
1s
메모리 제한
32MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Instead of paying attention in chemistry class, Luka is killing time playing with numbers again. This time, he wrote N positive integers so that they form a ring (circle). After that he formed a new ring by adding to each number its two neighbours. The teacher noticed this and took away the first piece of paper, with the original ring. This did not trouble Luka much because he knows he can use the other ring to reconstruct the original. Write a program that solves Luka's problem.

입력

The first line contains the integer N (3 ≤ N ≤ 10 000), the number of integers in the rings. Each of the following N lines contains an integer less than 109 (one billion). These numbers, in order, form the second ring. The input will be such that a solution, although not necessarily unique, will always exist.

출력

Output the original ring on N lines. The numbers must be positive. Rotating the ring is not allowed. For example, the sum of the first three output numbers must be equal to the second number in the input ring. Note: The solution need not be unique.

예제 입력 1

3
5
5
5

예제 출력 1

2
1
2

예제 입력 2

4
20
15
17
14

예제 출력 2

5
8
2
7

예제 입력 3

5
7
8
9
10
11

예제 출력 3

4
1
3
5
2
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Gold III1명 투표· 약 1개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.