HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Array and Matrices > problem:


50875 - Take m-out

Guest
• Review clarifications (3)

Volume problems

• 50418 - Student averages
• 50420 - Teachers Sightseeing
• 50384 - Permutations revisited
• 50841 - My grand-grand-grandfather
• 50395 - Page "Like" Averages
• 50407 - Missing Number
• 50516 - Lines
• 50446 - Snake
• 50875 - Take m-out
• 50509 - Reading Book
• 50529 - Row to Table
• 50786 - Top Question
• 50788 - Eight Puzzle
• 50499 - Table to Row
• 50823 - Secret Number
• 50853 - Parking Place
• 50496 - Falling Bricks

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.

Take m-out

When calculating averages, sometimes m-extremes are discarded in the average calculation. For example in a contest, if a jury member gives extreme grades (compared to the other jury members), his grades will not be used in calculation.

Question: Write a program that reads k grades for n students. Then, the program calculates the averages by discarding m-max-grades and m-min-grades. Show the top 5 winners in the end.

Input specification
You will be first given three numbers:

  • the number of competitors (n): an integer between 5 and 2,000
  • the number of grades (k): where k is between 3 and 50 and each grade is between 0 and 1000
  • the number of extremes to discard (m) where 0 ≤ m < (k/2)
Then in the following n lines, you will be given information for n competitors. Each line starts with name and surname followed by k grades.

Output specification:
Show the names of top 5 competitors descending order according to their average grades.

Sample Input I
7 5 1
Ahmet Haxhiaj 44 38 67 99 61
Enes Hoxhalli 73 78 50 46 66
Hilda Cole 53 48 30 41 98
Florence Haliti 40 95 32 75 54
Rigelta Cami 81 77 32 56 72
Shkelzen Rrapi 79 62 55 59 50
Kimet Avdolli 64 85 99 64 47
Sample Output I
Kimet Avdolli
Rigelta Cami
Enes Hoxhalli
Shkelzen Rrapi
Ahmet Haxhiaj

Explanation: There are 7 competitors with 5 marks given. When calculating the averages, the smallest 1 grade and the max 1 grade are discarded. So, the average of middle 3 grades are calculated. The table below shows the average of top 5:

Name SurnameAverage
Kimet Avdolli71
Rigelta Cami68.33
Enes Hoxhalli63
Shkelzen Rrapi58.67
Ahmet Haxhiaj57.33



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

www.contester.ru