atcoder#ARC077A. [ABC066C] pushpush
[ABC066C] pushpush
Score : points
Problem Statement
You are given an integer sequence of length , . Let us consider performing the following operations on an empty sequence .
The -th operation is as follows:
- Append to the end of .
- Reverse the order of the elements in .
Find the sequence obtained after these operations.
Constraints
- and are integers.
Input
Input is given from Standard Input in the following format:
Output
Print integers in a line with spaces in between. The -th integer should be .
4
1 2 3 4
4 2 1 3
- After step 1 of the first operation, becomes: .
- After step 2 of the first operation, becomes: .
- After step 1 of the second operation, becomes: .
- After step 2 of the second operation, becomes: .
- After step 1 of the third operation, becomes: .
- After step 2 of the third operation, becomes: .
- After step 1 of the fourth operation, becomes: .
- After step 2 of the fourth operation, becomes: .
Thus, the answer is 4 2 1 3
.
3
1 2 3
3 1 2
As shown above in Sample Output 1, becomes after step 2 of the third operation. Thus, the answer is 3 1 2
.
1
1000000000
1000000000
6
0 6 7 6 7 0
0 6 6 0 7 7