DISPER
Time limit2sMemory limit512 MB
For each professor, treat all student marks as one set, compute the variance of those marks, and report the professor with the highest dispersion to two decimals.
- Level
Easy3 of 10
- Topics
- Math, Implementation, Array
- Solved
- No attempts yet
Problem
The university of "AAA" is interested in investigating and evaluating the performance of its professors. It wants to know who has the least consistency. For this purpose, the university needs to find an approach that considers the contribution of all of a student's marks as a single mark. The university found that the variance of marks can help it find who has the least consistency. In general, the less consistent a professor is, the higher the dispersion. The highest mark a student can have is limited to 100, and all students take exactly the same number of courses. Also, for any student who missed a course, the mark is considered to be the lowest possible mark. Variance formula:
In this formula, x represents a mark and μ represents the mean value of the marks. N stands for the number of marks.
σ = Σ(x - μ)2 / N
Input
The first line contains the number of test cases (T): 1 ≤ T ≤ 100
The second line gives the number of professors to be evaluated. P ranges from 1 ≤ P ≤ 30. Therefore, the next P lines contain the marks for each professor separated by ", ".
Each mark M is an integer (0 ≤ M ≤ 100)
Output
Output the P-th professor with less consistency and its dispersion score with an accuracy of 2 decimal places, separated by a tab.