14069 - Division   

Description

There are n apples with known weights. Please divide the apples into two groups so that the difference between the weights of the groups is minimal.

Input

The first line contains an integer T, represents the test numbers.

The first line of each testcase is an integer N, represents the number of apples.

The second line of each testcase has N numbers, represent the weight of each apple.

 

T <= 10, N <= 20, 0 <= ai <= 1e9

Output

Please output the minimum difference between the weights of the groups.

Don't forget to print a '\n' at the end.

Sample Input  Download

Sample Output  Download

Tags




Discuss