// Problem#: 1688
// Submission#: 1657719
// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
// URI: http://creativecommons.org/licenses/by-nc-sa/3.0/
// All Copyright reserved by Informatic Lab of Sun Yat-sen University
#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
int main()
{
int test;
cin >> test;
while (test--)
{
int n,arr[10005];
scanf ("%d",&n);
for (int i = 0; i < n; i++)
scanf ("%d",&arr[i]);
sort(arr,arr+n);
int head = 0;
int rear = n - 1;
for (int j = 0; j <= n/2; j++)
{
printf ("%d ",arr[head]);
head++;
if (rear > head)
{
printf ("%d ",arr[rear]);
}
rear--;
}
printf ("\n");
}
return 0;
}
sicily 1688 Soldiers
最新推荐文章于 2019-08-17 09:31:27 发布