#C13884. Reverse Sum of the Array

    ID: 43471 Type: Default 1000ms 256MiB

Reverse Sum of the Array

Reverse Sum of the Array

Given an array \(a_1, a_2, \ldots, a_n\), you are required to compute a new array \(b_1, b_2, \ldots, b_n\) such that \(b_i = a_i + a_{n-i+1}\) for \(1\leq i\leq n\). In other words, each element of the resulting array is the sum of the corresponding element from the original array and its mirror element.

For example, if the input array is [3, 1, 4, 1, 5, 9], then the reversed array is [9, 5, 1, 4, 1, 3] and the output array will be [12, 6, 5, 5, 6, 12].

inputFormat

The first line of input contains a non-negative integer \(n\) denoting the number of elements in the array. The second line contains \(n\) space-separated integers representing the array.

outputFormat

Output a single line containing \(n\) space-separated integers. The \(i\)-th integer should be \(a_i + a_{n-i+1}\). If \(n = 0\), output an empty line.

## sample
6
3 1 4 1 5 9
12 6 5 5 6 12

</p>