Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Question by Ibrahim Mesecan.
Comparing Exams
Exam preparation agency (EPA) from
the ministry wants to test the quality of
exams. And you are assigned to prepare
one section of this analysis. You will prepare a
list according to the following criteria
where success of an exam for the
results of k students is the sum of the absolute
differences of each grade from the class average.
The higher is the better.
Question:
Write a program that is going to calculate the success
of n exams and sort them in descending order and show
the ids of top m exams.
Input specification
In the first line, you will be given three numbers: The
number of exams(n) and the number of students (k),
The number of top exams to show (m).
Then, in the following n lines, you will be given k
integers which are between -10,000 and 10,000 and 1 ≤ m ≤ n
≤ 20,000 and 1 ≤ k ≤ 2,000.
Output specification
Show ids of top m exams.If there are two exams with the same result
show the exam with a smaller id first.
Sample Input I
3 3 2
9 10 8
9 6 3
10 7 10
|
Sample Output I
2 3
|
The class averages are 9, 6 and 9. The sum of
absolute differences of each grade from the class average:
- For the first exam: 0 + 1 + 1 = 2
- For the second exam: 3 + 0 + 3 = 6
- For the third exam: 1 + 2 + 1 = 4
Then the sorted list of exams will 2, 3 and 1.
Для отправки решений необходимо выполнить вход.
|