#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 mm volunteers are planned to be recruited, the interview cutoff line is the score of the candidate ranked at m×150m \times 150% (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 nn and mm (5n50005≤n≤5000, 3mn3≤m≤n), separated by a space, where nn is the total number of candidates who took the written test, and mm is the planned number of volunteers to be recruited. The input data guarantees that m×150m \times 150% rounded down is less than or equal to nn.
The next nn lines each contain two integers, separated by a space, representing the candidate's registration number kk (1000k99991000≤k≤9999) and their written test score ss (1s1001≤s≤100). 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 88
88 5
1005 95
2390 95
1000 90
1001 88
3239 88