Rearrange

0

0 votes
Easy
Problem

Given a sorted array, rearrange  the array alternately i.e first element should be max value, second min value, third second max, fourth second min and so on.

Input:
First line of input ia the number of test cases T. First line of test case contain the array size 'N' and second line of test case contain the array.


Output:
Numbers in the required form are displayed to the user.


Constraints:
1 <=T<= 30
1 <=N<= 100
1 <=arr[i]<= 1000

 

Sample Input
2
6
1 2 3 4 5 6
11 
10 20 30 40 50 60 70 80 90 100 110
Sample Output
6 1 5 2 4 3
110 10 100 20 90 30 80 40 70 50 60
Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?