Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/massiv-chetlardan-yigindilar

Pair sums from the ends

Easy 1000 ms 64 MB 21%
Share

An array with an even number of elements is given. Find the sum of the first and the last elements, the sum of the second and the second-to-last, and so on up to the middle of the array, and print them in this order.

Array elements joined in pairs by arcs from the ends to the middle; the sum of each pair below

Input

The first line contains a positive integer $n$.
The second line contains $n$ integers — the elements of the array.

Output

$n / 2$ integers separated by spaces.

Note

$2 \le n \le 1000$, $n$ is even
the elements are from $-10^{6}$ to $10^{6}$

Examples

Input #1
6
1 4 2 7 3 5
Output #1
6 7 9
Input #2
2
-3 3
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.