DCP-38: Mysterious Pond Back to All Problems

Beginner Beginners Problems > Ad-hoc


There is a mysterious pond in a forest of Savar. N numbers of friends of your brother Robi have gone to visit that pond, and you know all of them. To see the crystal clear water, they have decided to get down and they have got down in the pond, but getting down in the pond nobody can come back (they don’t know that before). After knowing this matter, your brother was so worried about his friends. You were so curious and said to your brother “I want to see this mysterious pond and know the real reason and also help them”. So after 50 minutes later, you have reached at the side of that pond and met the queen of the forest named Engky. She laughed and said to you- “I know where they are, I will give them back but you have to answer one of my question”. I will tell you each friend’s name(Fn) & time in minutes(Fm) of getting down all of them from now. Now you have to tell the name who got down at first & at last in the pond. Write a program to find answers. Note: They didn’t get down at the same time in the pond. Input: ------ Input start with an integer T(1≤T≤100) T means test case. Each test case contain an integer N(3≤N≤20). N means numbers of Robi’s friends. Next N line contains Fn (each friends name, length of the name will be 50 and contains small/capital characters) and after a space 5≤Fm≤10^6 (getting down time in minutes) in a single line of each N line. Output: ------- For each case, print: “X Y” (without quote), where X is the name of first person and Y is the name of last person, use new line after each case. Sample Input ------------ 1 5 Ayan 20 Punom 11 Eifty 9 Prioti 15 Surovi 12 Sample Output ------------- Ayan Eifty


Problem Setter:

Adnan Sarker

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C/C++ 1.00
Java 2.00
C# 2.00
PHP 2.00

Problem Stats

122/211

Solve/Submission

Ranking

# User Language Timing
01 MarufAhmed Cpp 0.00s
02 ishrafislam2727 Cpp 0.00s
03 emrul Cpp 0.00s
04 Mubeen Cpp 0.00s
05 Ansarul_14 Cpp 0.00s
06 Ashish972 Cpp 0.00s
07 ash12 Cpp 0.00s
08 Uap_Amit Cpp 0.00s
09 maxhasan Cpp 0.00s
10 gazi93 Cpp 0.00s
11 terminator_c Cpp 0.00s
12 rezaul_karim Cpp 0.00s
13 Nurul_CSE Cpp 0.00s
14 joy25896 Cpp 0.00s
15 Nazmul0092 Cpp 0.00s
16 Snails Cpp 0.00s
17 sadia2427 Cpp 0.01s
18 nazmul_bzs Cpp 0.01s
19 Khayrul_34 Cpp 0.01s
20 ronok_cse Cpp 0.01s
21 mhsjaber CSharp 0.05s
22 mahrahat Cpp 0.07s
23 Ridwan_bracu Cpp 0.07s
24 anis Cpp 0.07s
25 akram Cpp 0.07s
26 marineCoder Cpp 0.08s
27 Dinar Cpp 0.08s
28 njrafi Cpp 0.08s
29 ishtupeed Cpp 0.14s
30 arsho PHP 0.16s
31 ArifKhanShubro Cpp 0.18s
32 Sarwar_sojol Cpp 0.21s
33 sk_roy Cpp 0.22s
34 cse_nazmul Cpp 0.23s
35 monsurmp Cpp 0.24s
36 anwar3606 Cpp 0.25s
37 Ashish_Deb Cpp 0.28s
38 SiyamEWU Cpp 0.28s
39 ih_hira Cpp 0.28s
40 haasib Cpp 0.30s
41 shamiul_pust Cpp 0.32s
42 mahbub07 Cpp 0.32s
43 iamramzan Cpp 0.34s
44 RakibR3 Cpp 0.34s
45 ImagineWarrior Cpp 0.35s
46 tashfiq123 Cpp 0.36s
47 mamun4122 Cpp 0.37s
48 rayhan50001 Cpp 0.38s
49 subhashis_cse Cpp 0.39s
50 showmic Cpp 0.40s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support