HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > SEM 2 - W4 > problem:


2012-11-20. 50792 - The student with the highest average

SEM 2 - W4

Start: Mar.28.2023 at 04:41:52 PM
Finish: Apr.04.2023 at 08:41:52 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (2)

Contest problems

• 50730 - The largest product
• 50731 - The largest product (2)
• 50732 - Sorting
• 2012-11-20. 50792 - The stude...
• 2nd-4. 50513 - Climbing Up the Stairs

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