#C826. Minimum Sum After Split and Reverse
Minimum Sum After Split and Reverse
Minimum Sum After Split and Reverse
You are given T test cases. For each test case, you are given an integer N (the number of elements in the array) followed by N space-separated integers representing the array A.
Your task is to compute the minimum sum of the elements of array A after performing a split and reverse operation exactly once on the array. Note that the split and reverse operations do not affect the overall sum of the array, so the answer for each test case is simply the sum of its elements.
Input Constraints:
- 1 ≤ T ≤ 104
- 1 ≤ N ≤ 105
- Each element of A is an integer such that |A[i]| ≤ 109
Example:
Input: 2 4 1 2 3 4 3 3 1 2</p>Output: 10 6
inputFormat
The first line of input contains a single integer T, the number of test cases. Each test case consists of two lines:
- The first line contains an integer N, the number of elements in the array.
- The second line contains N space-separated integers representing the array A.
outputFormat
For each test case, output a single line containing the sum of the N integers in the array A.
## sample2
4
1 2 3 4
3
3 1 2
10
6
</p>