#K94072. Top Scores
Top Scores
Top Scores
You are given multiple test cases. For each test case, the first line contains an integer N representing the number of scores, followed by a line containing N scores. Your task is to extract the distinct scores from each test case and print them in descending order.
Note: The output should combine the results of all test cases. For example, if the first test case produces scores [300, 200, 100] and the second produces [50, 40, 30], the output should be:
300 200 100 50 40 30
The problem involves basic manipulation of arrays, sets, and sorting. Ensure your solution reads from standard input (stdin) and writes to standard output (stdout).
inputFormat
The input begins with a single integer T indicating the number of test cases. For each test case:
- The first line contains an integer N, the number of scores.
- The second line contains N space-separated integers representing the scores.
All input should be read from standard input (stdin).
outputFormat
For each test case, output the distinct scores in descending order with each score printed on a new line. Combine the outputs of all test cases in the order they are given. All output should be written to standard output (stdout).
## sample2
5
100 200 300 200 100
4
50 50 40 30
300
200
100
50
40
30
</p>