HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > Lab10 - CEN ECE > problem:


50733 - The Highest Average

Lab10 - CEN ECE

Start: Nov.28.2023 at 12:14:08 AM
Finish: Dec.14.2023 at 11:14:08 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (3)

Contest problems

• 50423 - Numbers square
• 50394 - Water Bills
• 50733 - The Highest Average
• 50366 - Student Averages (2 Grades)
• 50501 - The Highest Average
• 50463 - Drawing a Triangle
• 50466 - Drawing Square From Stars
• 14-FallResit-10. 50537 - esreveR Tri...
• 14-Spr2-40. 50438 - Pattern with stars
• 15-Fall-01. 50806 - TVSH
• 15-FallHW-1. 50820 - Post Office

Feedback

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

Time limit 4000/7000/7000/7000 ms. Memory limit 65000/65000/65000/65000 Kb.
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.

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

www.contester.ru