Problem C
ICPC Team Selection
The coach of Nha Trang University, Mr. Van, has just
organized a contest to form its ICPC teams. There were students
participating in the contest. The
The coach wants to form
The coach wants to maximize
Input
The input consists of several datasets. The first line of
the input contains the number of datasets which is a positive
integer and is not greater than
Each dataset is described by the following lines:
-
The first line contains a positive integer
. -
The second line contains
positive integers .
Output
For each dataset, output the value
Explanation for the Sample Dataset
One way to form two teams is:
-
Team
: student , student , student ; -
Team
: student , student , student .
Sample Input 1 | Sample Output 1 |
---|---|
1 2 8 8 6 9 10 9 |
17 |