#C8857. Statistical Score Report Generator
Statistical Score Report Generator
Statistical Score Report Generator
This problem requires you to generate a statistical report from one or more datasets of scores. For each dataset, you are to compute and output the following four values:
- Highest Score: The maximum score in the dataset.
- Lowest Score: The minimum score in the dataset.
- Mean Score: The arithmetic mean of the scores, computed as \(\frac{\text{sum of scores}}{n}\), and rounded to two decimal places.
- Median Score: The median value of the dataset. If the number of scores \(n\) is even, it is computed as \(\frac{a_{\frac{n}{2}}+a_{\frac{n}{2}+1}}{2}\) (after sorting), rounded to two decimal places; if \(n\) is odd, it is the middle value.
The input begins with an integer indicating the number of datasets. Each dataset starts with an integer denoting the number of scores, followed by the scores themselves. For each dataset, output the report in the format shown below. Separate the report of different datasets by an empty line.
inputFormat
The first line contains a single integer \(T\), the number of datasets. Each of the following \(T\) datasets is given on its own line. Each dataset starts with an integer \(n\) (the number of scores), followed by \(n\) integers representing the scores, separated by spaces.
outputFormat
For each dataset, print exactly four lines in the following format:
Highest score: X Lowest score: Y Mean score: M Median score: D
where X and Y are integers, and M and D are floating-point numbers rounded to two decimals. If there are multiple datasets, separate each dataset's output with an empty line.
## sample2
5 90 100 78 85 92
4 88 75 95 82
Highest score: 100
Lowest score: 78
Mean score: 89.00
Median score: 90.00
Highest score: 95
Lowest score: 75
Mean score: 85.00
Median score: 85.00
</p>