PEG Test – Oct 3rd, 2014
Korra is trying to restore balance to the world. But before that, she
must restore balance in some numbers. Given
Output the minimum difference between the two groups of numbers.
Input Specification
The first line will contain the integer
The second line will contain
Output Specification
Output a single line containing a single integer – the minimum difference of the sum of the two groups of numbers.
Sample Input 1
Copy
5
8 12 16 100 20
Sample Output 1
Copy
44
Sample Input 2
Copy
9
1 8 5 9 7 2 3 4 6
Sample Output 2
Copy
1
Comments