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!
The first line of input consists of a single integer T, the number of test-cases. Each test-case consists of a line containing n (2 <= n <= 34), number of cows. n lines follow. i-th line contains the Puzzle Solving Power of i-th cow. Puzzle Solving Power of a cow is a non-negative number less than 10,000,000. There is a blank line between two consecutive test-cases.
For each test-case, output a line containing the minimum difference which can be achieved.
Author: Hadi Moshayedi
Source: AUT Contest 1