HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Array and Matrices > problem:


50792 - The student with the highest average

Guest
• Review clarifications (2)

Volume problems

• 50756 - Average of the Nth Student
• 50758 - National Elections - Revisited
• 50458 - Weekly Report
• Raporti Javor
• 50555 - Frequency of Letters
• 50592 - Matrix Multiplication
• 50653 - Long Divide
• 50767 - Censor
• 50792 - The student with the hi...
• 060. 50389 - Reverse an Array
• 100. 50330 - Find the average of n ...
• 110. 50359 - Mode of a Series
• 120. 50329 - Draw Matrix-1
• 120. 50331 - Number of Numbers o...
• 155. 50726 - Pascal Triangle - 1
• 180. 50755- Top N Donors - 1
• 190. 50734 - Product Info (In Srt)

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