当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。
There are some positive integer numbers, and you want to divide them into two nonempty sets (every integer should be in and only in one set) and get a value descripted below:
Assume that set A has $n_1$ numbers $A_1,A_2,…,A_{n_1}$; set B has $n_2$ numbers $B_1,B_2,⋯,B_{n_2}$;
Let
Then
We want to know the largest ans.
The first line of the input is an integer T (T≤1000), which stands for the number of test cases you need to solve.
Every test case begins with an integer N (2≤N≤1000), then followed by N positive integers on the next line, these numbers will not exceed 1000
2 3 1 1 1 3 1 2 3
Case #1: 0.000000 Case #2: 7.250000
时间上限 | 内存上限 |
1000 MS | 128 MB |