~/algor $ cat problems/massiv-toq-indekslar-teskari
Odd-index elements in reverse
Easy
1000 ms
128 MB
21%
A positive integer $n$ and an array of $n$ integers are given. Print all elements of the array with odd indices ($1, 3, 5, \dots$) in decreasing order of index.
Input
The first line contains a positive integer $n$. The second line contains $n$ integers separated by spaces.
Output
One line with the elements at odd indices separated by spaces, in decreasing order of index.
Note
$1 \le n \le 1000$
$-10^{9} \le a_{i} \le 10^{9}$
Examples
Input #1
6 10 20 30 40 50 60
Output #1
50 30 10
Input #2
5 1 2 3 4 5
Output #2
5 3 1