#C7288. Adjusted Player Scores

    ID: 51142 Type: Default 1000ms 256MiB

Adjusted Player Scores

Adjusted Player Scores

In this problem, you are given the scores of multiple players over several rounds. For each player, the first integer in the input represents the number of rounds they played, followed by their scores in each round. The final adjusted score for a player is computed as the sum of all scores minus the lowest score. If a player has participated in only one round, the adjusted score is defined to be 0.

Formally, let ( s_1, s_2, \dots, s_n ) be the scores of a player where ( n ) is the number of rounds. If ( n = 1 ), then the adjusted score is 0; otherwise, it is given by:

[ \text{Adjusted Score} = \sum_{i=1}^{n} s_i - \min_{1 \leq i \leq n} s_i. ]

You need to read input from stdin and write the output to stdout.

inputFormat

The input starts with an integer ( p ) denoting the number of players. Each of the next ( p ) lines contains a series of space-separated integers. The first integer of each line is ( n ), representing the number of rounds for that player, followed by ( n ) integers which are the scores in each round.

outputFormat

For each player, output a single line containing their adjusted score as defined above.## sample

3
5 10 20 30 40 50
2 5 15
1 100
140

15 0

</p>