P21202 [CodeChef] ITGUY30
普及
题目描述

Cheffina challanges chef to rearrange the given array as arr[i] > arr[i+1] < arr[i+2] > arr[i+3].. and so on…, i.e. also arr[i] < arr[i+2] and arr[i+1] < arr[i+3] and arr[i] < arr[i+3] so on.. Chef accepts the challenge, chef starts coding but his code is not compiling help him to write new code.

-----Input:-----
- First-line will contain $T$, the number of test cases. Then the test cases follow.
- Each test case contains two lines of input, First $N$ as the size of the array.
- N space-separated distinct integers.

-----Output:-----
For each test case, output in a single line answer given to the Chefffina.

-----Constraints-----
- $1 \leq T \leq 10$
- $1 \leq N \leq 10^5$
- $1 \leq arr[i] \leq 10^5$

-----Sample Input:-----
2
4
4 1 6 3
5
4 5 1 6 3

-----Sample Output:-----
3 1 6 4
3 1 5 4 6

输入格式

见题面

输出格式

见题面

样例输入
['2', '4', '4 1 6 3', '5', '4 5 1 6 3']
样例输出
['3 1 6 4', '3 1 5 4 6']