HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Array and Matrices > problem:


50792 - The student with the highest average

Guest
• Review clarifications (2)

Volume problems

• 50569 - 12th Grade Elective Subjects
• 50585 - Inner Product
• 50587 - Modular Conversion
• 50592 - Matrix Multiplication
• 50594 - Transformations
• 50653 - Long Divide
• 50767 - Censor
• 50768 - Where is Waldorf?
• 50792 - The student with the hi...
• 51182 - Count and Sum 2
• 51193 - The max element of k-th co...
• 51196 - The sum of two arrays
• 51197 - Even and odd Numbers
• Problem 3
• 50468 - Draw Matrix - 2
• 010. 50381 - Sum of the numbers
• 030. 50737 - Sum of the k-largest n...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan.

The student with the highest average

Shqip

Your math professor stores exam results of the students in a text file, one student information per line. He wants to see the student with the highest average. Because not all the students are able to take all the exams, every student has different number of exams. To help you process the marks easily, the professor has placed -999 at the end of every line.

Input specification
The first line contains a number (n) that shows the number of students in the class where 0 < n ≤ 100. The following n lines contain n students' names and marks.
Each line starts with the name of the student. Student names are not longer than 15 characters and contain only English letters. The student names are followed by m integer marks of that student where 0 < m ≤ 100 and every mark is an integer number between 1 and 100. The last number in every line is -999 (minus 999) which shows the end of that student's marks.
Note: -999 is not calculated in the average.

Output specification
You will show the name and average of the student with the highest average. The average is double precision. But the program will take into account only the first three digits. The program uses
if (abs(yourCalculatedAverage-expectedAverage)>0.001) return ERROR;
to decide if given result is correct or not.

Sample Input:
5
Alban 50 55 60 65 -999
Gerald 67 62 43 -999
Ardit 71 82 90 91 85 -999
Elton 95 95 100 -999
Xhuljana 72 83 91 100 52 98 66 55 -999

Sample Output:
Elton 96.666


Для отправки решений необходимо выполнить вход.

www.contester.ru