F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Another Contest

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)
Total Submission(s): 748    Accepted Submission(s): 272


Problem Description
The contest is beginning again! To make the contest more interesting, Competition Commission has developed a new rule: There are N problems initially, and for each problem, if one get an "Accepted", he can get some points, equal to the number of contestants that did not solve the problem. The score of each contestant was equal to the sum of points assigned to the problems solved by that contestant.
iSea participated in the contest, but he is confused by the complicated scoring rules, and now he is staring at the results, unable to determine his place in the final standings. Help iSea by writing a program that calculates his score and his ranking.
Before the contest, the contestants were assigned unique IDs from 1 to S inclusive, and iSea's ID was P. The final standings of the competition list the contestants in descending order of their scores. In case of a tie, among the tied contestants, those who have solved more tasks will be listed ahead of those who have solved fewer tasks. In case of a tie by this criterion as well, the contestants with equal results will be listed in ascending order of their IDs.
 

Input
There are several test cases in the input.

The first line of each case contains three integers N, S, P (0 < N, S <= 1000, 1 <= P <= S), their meaning are the same as the description.
Then N lines follows, each line contains S integers, whether 0 or 1, indicating the result of S contestants solving the N problems, 0 means this contestant haven¡¯t solved this problem, 1 means solved.

The input terminates by end of file marker.
 

Output
For each test case, output two integers, indicating iSea¡¯s scores and ranking.
 

Sample Input
3 3 3 1 0 1 1 0 1 1 0 0
 

Sample Output
2 2
 

Author
iSea@WHU
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-05 03:16:21, Gzip enabled