
ZOJ Problem Set  2868
Farmer John is well known for his great cows. Recently, the cows have decided to participate in the Incredible Cows Puzzle Contest (ICPC). Farmer John wants to divide the cows into two teams, and he wants to minimize the difference of Puzzle Solving Power of two teams. Puzzle Solving Power of a team is sum of Puzzle Solving Power of cows forming that team. Help F.J. to find the minimum difference! Input The first line of input consists of a single integer T, the number of testcases. Each testcase consists of a line containing n (2 <= n <= 34), number of cows. n lines follow. ith line contains the Puzzle Solving Power of ith cow. Puzzle Solving Power of a cow is a nonnegative number less than 10,000,000. There is a blank line between two consecutive testcases. Output For each testcase, output a line containing the minimum difference which can be achieved. Sample Input
2 Sample Output
0 Author: Hadi Moshayedi Source: AUT Contest 1 