#C11125. Archery Competition Ranking
Archery Competition Ranking
Archery Competition Ranking
The Kingdom's annual archery competition has just concluded, and you, as the head statistician, must process the results. There are N participants, each assigned a unique ID from 1 to N. The competition is held over K rounds. In each round, every participant scores some points. Your task is to compute the total score for each participant and determine the top M participants.
The total score for participant i is given by the formula:
\(S_i = \sum_{j=1}^K s_{ij}\)
where \(s_{ij}\) is the score of participant i in round j. In case of ties, the participant with the smaller ID is ranked higher. Finally, output the IDs of the top M participants in descending order of their total scores.
inputFormat
The input is given via standard input (stdin) in the following format:
N K M s11 s12 ... s1N s21 s22 ... s2N ... sK1 sK2 ... sKN
Here, the first line contains three space-separated integers: N (number of participants), K (number of rounds), and M (number of top participants to select). Each of the following K lines contains N integers representing the scores of the participants in that round.
outputFormat
Output via standard output (stdout) a single line containing the IDs of the top M participants, separated by a single space, in descending order of their total scores. In case of a tie, the participant with the smaller ID should come first.
## sample5 3 3
10 20 30 40 50
25 15 5 45 10
5 10 20 35 40
4 5 3