ALGOR Contest: Round #4 (Special Challenge)
Problem G · 300 points ·
ICPC rules
~/algor $ cat contests/round-4/G
G. Array in reverse order
1000 ms
128 MB
A positive integer $n$ and an array of $n$ integers are given. Print all its elements in reverse order:
$$a_{n}, \quad a_{n-1}, \quad \dots, \quad a_{1}$$
Input
The first line contains a positive integer $n$. The second line contains $n$ integers separated by spaces.
Output
One line with $n$ integers separated by spaces.
Note
$1 \le n \le 2 * 10^{5}$
$-10^{9} \le a_{i} \le 10^{9}$
Examples
Input #1
5 1 2 3 4 5
Output #1
5 4 3 2 1
Input #2
4 -7 0 12 3
Output #2
3 12 0 -7