#P439. 练76.3 分数线划定
练76.3 分数线划定
Description
The selection of World Expo volunteers is in full swing in City A. To select the most suitable candidates, City A conducted a written test for all applicants. Only those who score above the interview cutoff line can proceed to the interview. The interview cutoff line is set at 150% of the planned number of volunteers to be recruited. For example, if volunteers are planned to be recruited, the interview cutoff line is the score of the candidate ranked at % (rounded down). All candidates with scores not lower than the cutoff line will enter the interview. Please write a program to determine the interview cutoff line and output the registration numbers and written test scores of all candidates who enter the interview.
Input Format
The first line contains two integers and (, ), separated by a space, where is the total number of candidates who took the written test, and is the planned number of volunteers to be recruited. The input data guarantees that % rounded down is less than or equal to .
The next lines each contain two integers, separated by a space, representing the candidate's registration number () and their written test score (). It is guaranteed that all registration numbers are unique.
Output Format
The first line contains two integers, separated by a space: the first integer is the interview cutoff line, and the second integer is the actual number of candidates who enter the interview.
Starting from the second line, each line contains two integers, separated by a space, representing the registration number and written test score of a candidate who enters the interview. The output should be sorted by written test score in descending order; if scores are the same, sort by registration number in ascending order.
Sample
6 3
1000 90
3239 88
2390 95
7231 84
1005 95
1001 8888 5
1005 95
2390 95
1000 90
1001 88
3239 88