The institute provides TAs for all students to ‘take care’ of the students. Every student gets a TA. As per a new policy of the institute there is 1 TA for every k students. Assign TAs to students roll number wise. The first TA as per input gets the first k students, the 2nd TA gets the next k students and so on. The last TA gets all the left over students that may be less than, equal to or greater than k. Please make sure that every TA and student should only be stored once in the memory, and not be copied along with every student.
The first input is the number of test cases. Thereafter each test case specifies t, the number of TAs and n, the number of students and k, the number of students per TA. The next t lines mention the roll number and name of TA and the next n lines specify the roll number and name of the student. Print the student name along with the TA that the student is assigned to.
Sort all students. The first TA (RSI2017002 Haider) gets the first and second student, the second TA (RSI2016001 Vaibhav) gets the third and fourth student. All remaining students are given to the last TA (RSI2016504 Lhilo)