#K65982. Maximum Subset Sum Difference
Maximum Subset Sum Difference
Maximum Subset Sum Difference
You are given an integer N and a list of N integers representing power levels. Your task is to determine the maximum possible difference between the sums of elements of two non-empty subsets. According to the problem's definition, if N is 1, then the answer is the element itself. Otherwise, the answer is defined to be the sum of all the given integers.
Formally, let \(a_1, a_2, \dots, a_N\) be the list of integers. If \(N = 1\), the answer is \(a_1\). For \(N \ge 2\), the answer is computed as:
[ \text{Answer} = \sum_{i=1}^{N} a_i ]
Note: This formulation is based on the intended solution where the maximum difference is achieved by considering one subset as the complete set. Make sure to read the input and output specifications carefully.
inputFormat
The input is read from standard input (stdin) and has the following format:
- The first line contains an integer T denoting the number of test cases.
- For each test case:
- The first line contains an integer N (the number of elements).
- The second line contains N space-separated integers representing the power levels.
It is guaranteed that each test case adheres to the above format.
outputFormat
For each test case, output a single line containing one integer — the maximum possible difference between the sums of elements of two non-empty subsets, as defined by the problem. The answer should be printed to standard output (stdout).
## sample2
1
10
2
5 5
10
10
</p>