#C1410. Minimum Subset Sum Difference Partition
Minimum Subset Sum Difference Partition
Minimum Subset Sum Difference Partition
Given a list of ( n ) integers, partition the list into two subsets such that one subset has exactly ( \lfloor \frac{n}{2} \rfloor ) elements and the other contains the remaining elements. Your task is to determine the minimum absolute difference between the sums of the two subsets. Formally, if the sums of the subsets are ( S_1 ) and ( S_2 ), find the minimum value of ( |S_1 - S_2| ).
Note: When ( n ) is odd, one subset will have ( \lfloor \frac{n}{2} \rfloor ) elements while the other will have ( n - \lfloor \frac{n}{2} \rfloor ) elements.
inputFormat
Input is provided from standard input and consists of a single line containing space-separated integers. The number of integers ( n ) satisfies ( 1 \le n \le 20 ), and each integer is in the range ( [-10^6, 10^6] ).
outputFormat
Output a single integer to standard output representing the minimum absolute difference between the two subsets.## sample
1 6 11 5
1
</p>