#t549. 谁考了第k名
谁考了第k名
Who Ranked k-th
Problem Description
In an exam, all students have different scores. Given each student's ID and score, find the ID and score of the student ranked -th.
Input Format
The first line contains two integers: the number of students () and the rank to query ().
The following lines each contain one student's ID (an integer) and score (a floating-point number), separated by a space.
Output Format
Output the -th student's ID and score, separated by a space. (Note: output the score using %g.)
Sample Input
5 3
90788001 67.8
90788002 90.3
90788003 61
90788004 68.4
90788005 73.9
Sample Output
90788004 68.4
Sample Explanation
In the input and . The five students' scores sorted from high to low are:
- 1st: ID , score ;
- 2nd: ID , score ;
- 3rd: ID , score ;
- 4th: ID , score ;
- 5th: ID , score .
So the 3rd student is the one with ID and score . Output the ID and score separated by a space, as shown in the sample output.
Constraints
, . The ID is an integer and the score is a floating-point number. All students' scores are different.