Лимит времени 4000/7000/7000/7000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Prepared by Ibrahim Mesecan.
Mr. Hoxha gives math lessons in a high school. He keeps his student records in a file. He normally has
two exams, two homework and two quizzes in a semester. That is a regular student takes 6 exams, but not all students
can take all the exams. Sometimes because of some personal problems students skip some exams. Mr. Hoxha accepts
excuses up to two exams. If a student has four, five or six exams, then his average is calculated out of the exams
that he has taken. But if any student takes less than four exams his average is calculated out of four exams.
Write a program that reads the name, surname and exam information for n students and then shows
the student with the highest average.
Input specification
You will be given a number (n) at the beginning. Then n lines of
student information.
Every line will first contain name and surname of the student
followed by at most 6
integer grades where 1 ≤ n ≤ 100 and 1 ≤
everyGrade ≤ 100
The marks of every student ends with a negative number (-1).
Output specification
Show name surname and the floating point average of the
student who has the highest average in the class. The average
must have 2 digits precision after the floating point. If there
are several students with the same max average show the first
student according to the given order.
|
Sample Input:
5
Arben Hoxha 76 50 70 80 80 -1
Artur Dardani 100 100 -1
Klevis Shehu 100 100 100 -1
Alban Mehmeti 90 90 80 82 -1
Ervin Murataj 70 70 60 70 70 80 -1
|
Sample Output:
Alban Mehmeti 85.5
|
|
Output Explanation :
Student list according to their averages |
Arben Hoxha 71.2
Artur Dardani 50.0
Klevis Shehu 75.0
Alban Mehmeti 85.5
Ervin Murataj 70.0
|
According to these results, Alban Mehmeti has the highest average in the class.
Для отправки решений необходимо выполнить вход.
|