#72Easy
From the edges inwards
Time: 1 s · Memory: 256 MB
- Arrays
Statement
You are given an array of numbers. Print its elements in this order: first, last, second, second to last, and so on —
Input format
The first line contains (). The second line contains integers ().
Output format
A single line with numbers — each element exactly once.
Examples
Input
5 1 2 3 4 5
Output
1 5 2 4 3
Input
6 1 2 3 4 5 6
Output
1 6 2 5 3 4
Note
Use two indices: one from the start () and one from the end (). Print and in turn and move them towards the middle. When is odd, the middle element is printed once: 1 5 2 4 3 in the first example.
