ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Сортировка и последовательности > задача:


50875 - Take m-out

Гость
• Вопросы к жюри (3)

Задачи раздела

• 50906 - The Smallest Pair
• 50549 - k-Nearest Neighbours (kNN)
• 50418 - Student averages
• Word Puzzle
• 50748 - Gold Store
• 50875 - Take m-out
• 50766 - Word Puzzle
• 50509 - Reading Book
• 50934 - Selling Cars
• 50741 - DNA Distance
• 50746 - Most Visited
• 50749 - Min Distance
• 50915 - Trip to Korca
• 50802 - Comparing Exams

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
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