Kemija
의견: 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 \le N \le 10\,000\)), the number of integers in the rings.
Each of the following \(N\) lines contains an integer less than \(10^9\) (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.
Scoring: In test cases worth \(70\%\) of points, \(N\) will be less than \(100\).
| 서브태스크 | 점수 | 설명 |
|---|---|---|
Subtask 1 | 70점 |
3
5
5
52
1
24
20
15
17
145
8
2
75
7
8
9
10
114
1
3
5
2평가 및 의견
Kemija
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Kemija