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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY