Лимит времени 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 Surname | Average |
Kimet Avdolli | 71 |
Rigelta Cami | 68.33 |
Enes Hoxhalli | 63 |
Shkelzen Rrapi | 58.67 |
Ahmet Haxhiaj | 57.33 |
Для отправки решений необходимо выполнить вход.
|