#C3816. Symmetric Pair Sum
Symmetric Pair Sum
Symmetric Pair Sum
Given a list of even-length integers, your task is to compute a new list where each element is the sum of pairs of entries that are equidistant from the ends. Formally, if the input list is (a_1, a_2, \ldots, a_{2n}), you need to output the list ( [a_1 + a_{2n},; a_2 + a_{2n-1},; \ldots,; a_n + a_{n+1}] ). This problem tests your ability to manipulate arrays and perform basic iterations.
inputFormat
The first line contains an even integer ( n ) indicating the number of elements. The second line contains ( n ) space-separated integers.
outputFormat
Output a single line with ( n/2 ) integers representing the sums of the symmetric pairs, separated by a single space.## sample
6
1 2 3 4 5 6
7 7 7