#include "iostream"
#include "algorithm"
using namespace std;
bool comp(int a, int b)
{
return a > b;
}
int main()
{
int TestCase;
cin >> TestCase;
while (TestCase--)
{
int ItemNum;
cin >> ItemNum;
int *n = new int[ItemNum];
for (int i = 0; i < ItemNum; i++)
cin >> n[i];
sort(n, n+ItemNum, comp);
int maxsum = 0;
for (int i = 2; i < ItemNum; i+=3)
maxsum += n[i];
cout << maxsum << endl;
}
}
sicily 1438
最新推荐文章于 2015-04-15 14:05:00 发布