HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Array and Matrices > problem:


50802 - Comparing Exams

Guest
• Review clarifications (2)

Volume problems

• 50786 - Top Question
• 50788 - Eight Puzzle
• 50509 - Reading Book
• 50529 - Row to Table
• 50499 - Table to Row
• 50823 - Secret Number
• 50853 - Parking Place
• 50496 - Falling Bricks
• 50802 - Comparing Exams
• 50785 - Swimming Contest
• 50866 - Buy the cheapest
• 50517 - Confusion Matrix
• 50515 - Lines - Revisited
• 50999 - Overlapping Trips
• 50507 - Sequential Numbers
• 50449 - The biggest result
• 50442 - Polynomial Addition

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.

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:

  1. For the first exam: 0 + 1 + 1 = 2
  2. For the second exam: 3 + 0 + 3 = 6
  3. For the third exam: 1 + 2 + 1 = 4
Then the sorted list of exams will 2, 3 and 1.



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

www.contester.ru