B. 奇怪的排序

    Type: Default 1000ms 256MiB

奇怪的排序

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

输入n个数,下标记为1~n。要求下标为奇数的数字按从小到大排序,下标为偶数的数字按从大到小排序。

Input

输入n。

输入不超过100000个整数。

Output

输出排序后的整数。

Sample Input

10
5 2 3 4 1 6 9 8 7 10

Sample Output

1 10 3 8 5 6 7 4 9 2

1.18竞赛B班

Not Attended
Status
Done
Rule
IOI
Problem
5
Start at
2025-1-18 13:45
End at
2025-1-18 15:45
Duration
2 hour(s)
Host
Partic.
8