#P1068. Volunteer Interview Selection

    ID: 12708 Type: Default 1000ms 256MiB

Volunteer Interview Selection

Volunteer Interview Selection

The City A is holding a large-scale selection for volunteers for the Expo. All candidates first take a written test. Only those whose scores reach a pre‐determined interview cutoff will be invited for an interview. The interview cutoff is determined by the planned acceptances. Specifically, if the plan is to recruit m volunteers, then the cutoff is set as the score of the candidate ranked at \(\lfloor1.5 \times m\rfloor\) in the written test results.

Given the list of candidates with their registration numbers and written test scores, determine the cutoff score and then output the registration numbers along with the scores of all candidates whose score is not less than the cutoff. The order of output should be the same as the input order.

Input Description

  • The first line of input contains two integers \(n\) and \(m\), where \(n\) is the number of candidates and \(m\) is the planned number of recruits.
  • Each of the following \(n\) lines contains a candidate's registration number (a string without spaces) and an integer representing their score.

Output Description

  • Output each candidate who qualifies for the interview (i.e. whose score is greater than or equal to the cutoff) in the same order as input. Each line should contain the candidate's registration number and score separated by a space.

inputFormat

The first line contains two integers n and m separated by space. Each of the next n lines contains a candidate's registration number and an integer score, separated by a space.

outputFormat

For each candidate whose score is greater than or equal to the interview cutoff, output a line containing the registration number and the score, separated by a space. The order should be the same as that of the input.

sample

5 2
W123 90
W234 80
W345 85
W456 70
W567 95
W123 90

W345 85 W567 95

</p>