Welcome to your Tape One day Jojo received a mysterious box which contains cassette tapes in front of his doorstep, it turns out that the tapes contain a voice recording made by someone and on each tape the narrator is talking about a different person. Jojo didn’t understand at all the purpose of these tapes but when he told about them to Lili she told him that she could think up to thirteen reasons why those recordings were being made. Anyway, Jojo decides to sort the tapes he found according to the alphabetical order of the names of the people being talked about on the tapes. Now help Jojo to tell whose tape is on the K-th order after he has done the sorting! Notes: The order is started from number 1. Format Input The first line contains a single number T, the number of testcases. Each testcase contains the number N, which is the number of tapes, and the number K. The next N lines contain Ai which is the name of the person being talked about on the i-th tape (before sorting). Format Output For each testcase, output one line starting with “Case #X: ” (without quotes) where X is the testcase number (starting from 1) followed by the name of the person whose tape is on the K-th order after Jojo has done the sorting. Constraints • 1 ≤ T ≤ 100 • 1 ≤ N ≤ 100 • 1 ≤ K ≤ N • 1 ≤ |Ai | ≤ 100 (|Ai | means the length of Ai) • Ai contains only the English letters a-z • All values of Ai in a testcase are different Sample Input 1 (standard input) 1 16 8 hannah clay zach tony justin tyler bryce jessica courtney alex jeff marcus monty sheri skye ryan Sample Output 1 (standard output) Case #1: justin Explanation The following is the order of the tapes after sorting: Alex, Bryce, Clay, Courtney, Hannah, Jeff, Jessica, Justin, Marcus, Monty, Ryan, Sheri, Skye, Tony, Tyler, Zach and thus the 8th tape is about the Justin. NOTE: USE C LANGUAGE (DONT USE STDLIB.H, ALGORITHM LIBRARY), USE BASIC CODE, PUT THE CODE UNDER int main(){ DO NOT USE VOID AND WHILE
Welcome to your Tape
One day Jojo received a mysterious box which contains cassette tapes in front of his doorstep, it turns out that the tapes contain a voice recording made by someone and on each tape the narrator is talking about a different person. Jojo didn’t understand at all the purpose of these tapes but when he told about them to Lili she told him that she could think up to thirteen reasons why those recordings were being made. Anyway, Jojo decides to sort the tapes he found according to the alphabetical order of the names of the people being talked about on the tapes. Now help Jojo to tell whose tape is on the K-th order after he has done the sorting! Notes: The order is started from number 1.
Format Input
The first line contains a single number T, the number of testcases. Each testcase contains the number N, which is the number of tapes, and the number K. The next N lines contain
Format Output
For each testcase, output one line starting with “Case #X: ” (without quotes) where X is the testcase number (starting from 1) followed by the name of the person whose tape is on the K-th order after Jojo has done the sorting.
Constraints
• 1 ≤ T ≤ 100
• 1 ≤ N ≤ 100
• 1 ≤ K ≤ N
• 1 ≤ |Ai | ≤ 100 (|Ai | means the length of Ai)
• Ai contains only the English letters a-z
• All values of Ai in a testcase are different
Sample Input 1 (standard input)
1
16 8
hannah
clay
zach
tony
justin
tyler
bryce
jessica
courtney
alex
jeff
marcus
monty
sheri
skye
ryan
Sample Output 1 (standard output)
Case #1: justin
Explanation
The following is the order of the tapes after sorting: Alex, Bryce, Clay, Courtney, Hannah, Jeff, Jessica, Justin, Marcus, Monty, Ryan, Sheri, Skye, Tony, Tyler, Zach and thus the 8th tape is about the Justin.
NOTE:
USE C LANGUAGE (DONT USE STDLIB.H,
DO NOT USE VOID AND WHILE
Step by step
Solved in 3 steps with 1 images