题目:https://codeforces.com/problemset/problem/1339/B
题意:
题解:只需要排序一下,然后从中间向外 开始输出。
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 1e5 + 5;
int a[N];
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i];
sort(a, a + n);
if (n & 1)
cout << a[n / 2] << " ";
for (int i = n / 2 - 1; i >= 0; i--)
cout << a[i] << " " << a[n - i - 1] << " ";
cout << endl;
}
}