#T148. 分数线划定

分数线划定

Description

The selection of volunteers for the World Expo is in full swing in City A.
To recruit the most suitable candidates, City A has conducted a written test for all registered participants. Only those who score above the interview cutoff line will proceed to the interview stage.

The interview cutoff line is determined based on 150% of the planned number of admissions. Specifically, if m volunteers are to be recruited, the cutoff line is set at the score of the participant ranked at the m×150% position (rounded down). All participants whose written test scores are not lower than this cutoff line will advance to the interview.

Your task is to write a program that calculates the interview cutoff line and outputs the registration numbers and written test scores of all participants who qualify for the interview.

Input Format

The first line contains two integers, n and m (5 ≤ n ≤ 5000, 3 ≤ m ≤ n), separated by a space. Here, n represents the total number of participants who took the written test, and m represents the planned number of volunteers to be recruited.
It is guaranteed that m×150% (rounded down) will not exceed n.

From the second to the (n+1)-th line, each line contains two integers separated by a space: the participant's registration number k (1000 ≤ k ≤ 9999) and their written test score s (1 ≤ s ≤ 100).
It is ensured that all registration numbers are unique.

Output Format

The first line should contain two integers separated by a space: the first integer is the interview cutoff line, and the second integer is the actual number of participants who qualify for the interview.

Starting from the second line, each subsequent line should contain two integers separated by a space: the registration number and the written test score of a qualifying participant. The participants should be listed in descending order of their scores. In case of tied scores, they should be sorted in ascending order of their registration numbers.

6 3
1000 90
3239 88
2390 95
7231 84
1005 95
1001 88

88 5
1005 95
2390 95
1000 90
1001 88