#K381. Summing Up Operations

    ID: 26123 Type: Default 1000ms 256MiB

Summing Up Operations

Summing Up Operations

You are given T test case(s). In each test case, you are given an array of n integers. An operation consists of selecting any two elements from the array, removing them, and inserting their sum back into the array. You must perform exactly n-1 operations so that only one element remains in the array.

The task is to compute the largest possible final value of the array after these operations. Note that regardless of the order in which operations are performed, the final value will always be equal to the sum of all elements in the array, i.e.,

$S = \sum_{i=1}^{n} a_i$

Print the computed sum for each test case on a separate line.

inputFormat

The input consists of multiple test cases. The first line of input contains an integer T representing the number of test cases. For each test case:

  • The first line contains an integer n, the number of elements in the array.
  • The second line contains n space-separated integers.

outputFormat

For each test case, output a single line containing the largest possible value of the final element after performing the operations, which is the sum of the array elements.

## sample
2
3
1 2 3
4
5 1 3 4
6

13

</p>