HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Sorting and sequences > problem:


50875 - Take m-out

Guest
• Review clarifications (3)

Section problems

• 50364 - Student averages
• 50333 - Series of Squares
• 50734 - Product Info (In Srt)
• 50735 - Top M Products
• 50339 - The Largest Rectangle
• 50492 - Contest Scoreboard
• 50737 - Sum of the k-largest numbers
• 50418 - Student averages
• 50875 - Take m-out
• 50748 - Gold Store
• 50766 - Word Puzzle
• 50741 - DNA Distance
• 50934 - Selling Cars
• 50746 - Most Visited
• 50509 - Reading Book
• 50749 - Min Distance
• 50915 - Trip to Korca

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