#C13807. Calculate Average Grades
Calculate Average Grades
Calculate Average Grades
In this problem, you are given several records. Each record contains a student's name and a list of their grades. Your task is to compute the average grade for each student using the formula (\text{average} = \frac{\text{sum of grades}}{\text{number of grades}}). If a student has no grades, output None
as the average. The results must be printed in the same order as the input.
inputFormat
The first line of the input contains an integer (N) indicating the number of students. Each of the next (N) lines contains a student's record. Each record starts with the student's name (a string without spaces), followed by an integer (k) representing the number of grades, and then (k) floating-point numbers representing the grades.
outputFormat
For each student, output a single line with the student's name and the average grade computed. If the student has no grades, print (None) instead of a number.## sample
4
Jane 3 90.5 85.0 92.5
Bob 2 70.0 75.5
Alice 4 88.0 92.5 91.0 85.5
Tom 0
Jane 89.33333333333333
Bob 72.75
Alice 89.25
Tom None
</p>