#C6539. Maximum Sum and Minimum Cost

    ID: 50310 Type: Default 1000ms 256MiB

Maximum Sum and Minimum Cost

Maximum Sum and Minimum Cost

You are given several test cases. In each test case, you are provided with an integer N and N integers representing the rarity values of items.

Your task is to compute two things for each test case:

  • The maximum possible sum of the rarity values, which is the sum of all values.
  • The minimum total cost required to achieve this sum by performing exchanges. Note that in this problem, no exchanges are needed, so the cost is always \(0\).

Input is read from standard input and output is written to standard output.

Note: All formulas are written in \(LaTeX\) format. In this instance, the answer is simply \(\text{sum} = \sum_{i=1}^{N} a_i\) and \(\text{cost} = 0\).

inputFormat

The input is given via standard input and is structured as follows:

  1. The first line contains an integer \(T\), the number of test cases.
  2. For each test case:
    1. The first line contains an integer \(N\), the number of rarity values.
    2. The second line contains \(N\) space-separated integers, representing the rarity values.

outputFormat

For each test case, output a single line containing two space-separated integers:

  • The maximum sum of the rarity values.
  • The minimum total cost (which is always \(0\) for this problem).

Output is printed to standard output.

## sample
3
3
1 2 3
4
5 7 2 8
2
10 20
6 0

22 0 30 0

</p>