#C14293. Average Student Grades from CSV

    ID: 43926 Type: Default 1000ms 256MiB

Average Student Grades from CSV

Average Student Grades from CSV

This problem requires you to compute the average grade for each student from a CSV file provided via standard input. The CSV file consists of a header and subsequent rows with three columns: Name, Subject, and Grade. You are to calculate the arithmetic mean of the grades for each student.

You might find the formula for the average useful: \( \bar{x} = \frac{\sum_{i=1}^{n} x_i}{n} \).

Output the results by printing each student's name and their average grade, formatted to one decimal place, sorted in lexicographical order by the student's name. Each line of the output should contain the student's name, a single space, and the average grade.

inputFormat

The input is provided on standard input (stdin) containing the content of a CSV file. The first line is the header "Name,Subject,Grade". Each subsequent line contains a student's record in the format:

Name,Subject,Grade

If the CSV contains only the header, the output should be empty.

outputFormat

The output should be written to standard output (stdout). For each student, print a line with the student's name, a space, and the average grade (formatted to one decimal place). The students must be listed in lexicographical order by their names. If there is no student data, output nothing.

## sample
Name,Subject,Grade
Alice,Math,85
Bob,Math,90
Alice,Science,92
Bob,Science,88
Charlie,Math,87
Charlie,Science,93
Alice 88.5

Bob 89.0 Charlie 90.0

</p>