HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Sorting and sequences > problem:


50802 - Comparing Exams

Guest
• Review clarifications (2)

Section problems

• 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
• 50802 - Comparing Exams
• 50927 - Health Expenses
• 50745 - Bitonic Sequence
• 50992 - Top K Obese Classes
• 50991 - Intersecting Circles
• 50447 - Swimming Contest - 2
• 50513 - Climbing Up the Stairs
• 50744 - The Smallest Perimeter
• 50743 - Total Scholarships Discount

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