HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN112 Homeworks 2013-2015 > problem:


15-SprResit-20. 50447 - Swimming Contest - 2

CEN112 Homeworks 2013-2015

Start: Dec.15.2013 at 12:00:00 PM
Finish: Dec.15.2013 at 05:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (2)

Contest problems

• 15-SprHW-40. 50746 - Most Visited
• 15-SprHW-60. 50516 - Lines
• 15-SprPr2-20. 50509 - Reading Book
• 15-SprPr2-60. 50766 - Word Puzzle
• 15-SprPr2-80. 50786 - Top Question
• 15-SprPrE1-20. 50785 - Swimming ...
• 15-SprPrE1-40. 50748 - Gold Store
• 15-SprPrE1-70. 50507 - Sequential ...
• 15-SprResit-20. 50447 - Swimm...

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.
Question by Ibrahim Mesecan.

Swimming Contest - 2

In swimming contests, the swimmers jump/fall into water from platforms of different heights while performing acrobatics. They are evaluated by many judges. Every judge gives a point between 0 and 10. When calculating the average of the swimmer, usually two of the evaluations (Max and min) are discarded and the average is calculated out of the rest of the judges. But this year, the organization committee has decided to discard the middle grade. There will be 5 juries, and you are asked to calculate the average grade by discarding the middle grade.

Question: Write a program that is going to read swimming information for n swimmers. Then, your program should calculate and show the top m medalists.

Input specification
You will be given two integers in the first line: n, the number of people and m: the number of top swimmers to show where 1 ≤ m ≤ n &le 10,000. Then, in the following n lines you will have the information for swimmers. In every line, first you will be given the name of swimmer and that is followed by 5 points given by the judges. The names contain at most 15 (only 26 English) letters and no special characters or space.

Output specification
Show the name of top m swimmers. If there are several swimmers with the same average, show the people in ascending name order.

Sample Input I
3 2
Shaun 8.4 5.6 7.2 9.2 8.1
George 5.4 8.7 6 9.9 7.6
Kim 7.5 5.2 5.9 9.1 8.5
Sample Output I
Shaun
George

When the middle grades are discarded the swimmers have the following averages:

  1. Shaun: 7.6
  2. George: 7.5
  3. Kim: 7.175


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

www.contester.ru