#K81717. Student Score Averaging
Student Score Averaging
Student Score Averaging
You are given a list of student records. Each record contains a student's name followed by a colon and a series of scores separated by commas. Your task is to compute the average score for each student, round the average to the nearest integer using the formula (\text{Average} = \text{round}(\frac{\text{sum of scores}}{\text{number of scores}})), and then output each student's name along with the computed average. The output should be sorted in lexicographical (alphabetical) order by the student's name.
For example, given the record "Alice:85,90,78", the average score is calculated as (\text{round}(\frac{85+90+78}{3}) = \text{round}(84.33) = 84).
inputFormat
The input is read from standard input (stdin). The first line contains an integer (N) which denotes the number of student records. Each of the following (N) lines contains a student record in the following format:
Name:Score1,Score2,...,ScoreK
Note that there is no extra spacing.
outputFormat
The output should be written to standard output (stdout). It consists of (N) lines. Each line should contain the student's name and the averaged score in the format:
Name:Average
The records must be sorted in ascending (lexicographical) order by the student's name.## sample
3
Alice:85,90,78
Bob:90,88,92
Charlie:70,75,80
Alice:84
Bob:90
Charlie:75
</p>