#K15616. Average Student Grades

    ID: 24397 Type: Default 1000ms 256MiB

Average Student Grades

Average Student Grades

You are given a list of students. For each student, you are provided the student's name and a list of their grades. Your task is to compute the average grade for each student and output the result. If a student has no grades, then the average is defined to be \(0.00\). The average must be rounded to two decimal places.

The computation for the average for a student having \(m\) grades \(g_1, g_2, \dots, g_m\) is given by:

[ \text{average} = \begin{cases} \frac{g_1+g_2+\dots+g_m}{m} & \text{if } m > 0, \ 0.00 & \text{if } m = 0. \end{cases} ]

You will read input from standard input and write the result to standard output.

inputFormat

The first line contains an integer \(n\) representing the number of students. Each of the following \(n\) lines describes a student. Each line starts with the student's name (a string without spaces), followed by an integer \(m\) (the number of grades), and then \(m\) integers representing the grades.

For example:

2
Alice 3 88 76 92
Bob 3 79 85 89

outputFormat

Output \(n\) lines to standard output. Each line should contain the student's name, a space, and the average grade rounded to two decimal places. The order of the output should be the same as the input.

For the input example above, the output should be:

Alice 85.33
Bob 84.33
## sample
2
Alice 3 88 76 92
Bob 3 79 85 89
Alice 85.33

Bob 84.33

</p>