# DCP-38: Mysterious Pond Back to All Problems

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 Limits

 Language Time Limit (seconds) C 1.00 C++ 1.00 C++14 1.00 C# 2.00 Go 2.00 Java 2.00 JavaScript 2.00 Objective-C 2.00 Perl 2.00 PHP 2.00 Python 2.00 Python3 2.00 Ruby 2.00 VB.Net 2.00

# 175/289

Solve/Submission

### Ranking

# User Language Timing
01 ash12 Cpp14 0.00s
02 Saimum_140128 Cpp14 0.00s
03 Nazmul0092 Cpp14 0.00s
04 emrul Cpp14 0.00s
05 reza_ul Cpp14 0.00s
06 maxhasan Cpp14 0.00s
07 gazi93 Cpp14 0.00s
08 atqrhmn Cpp14 0.00s
09 joy25896 Cpp14 0.00s
10 Aizen Cpp14 0.00s
11 pulak_ict_mbstu Cpp14 0.00s
12 Sagor Cpp 0.00s
13 Peregrine_Falcon Cpp14 0.00s
14 rezaul_karim Cpp14 0.00s
15 Nurul_CSE Cpp14 0.00s
16 mrinmoi Cpp14 0.00s
17 junayedmahmud Cpp14 0.00s
18 virus C 0.00s
19 feodorv C 0.00s
20 Freaky_Weirdo Cpp 0.00s
21 Ansarul_14 Cpp14 0.00s
22 JubayerSohel Cpp14 0.00s
23 jualahmed Cpp14 0.00s
24 Mhkhaled Cpp14 0.00s
25 Mubeen Cpp14 0.00s
26 MarufAhmed Cpp14 0.00s
27 Rakib05 Cpp 0.00s
28 terminator_c Cpp14 0.00s
29 Ashish972 Cpp14 0.00s
30 jayed_al_hasan Cpp14 0.00s
33 lolcoder Cpp14 0.00s
34 noyonhossen Cpp14 0.00s
35 Alamgir_1604069 Cpp14 0.00s
36 Foysal_36 Cpp14 0.00s
37 cse_1604068_rajon Cpp14 0.00s
38 opu1604073 C 0.00s
39 Tajir Cpp14 0.00s
40 CSE1604084_Mahir C 0.00s
41 DynamicOvi Cpp 0.00s
42 mh4746 Cpp14 0.00s
43 Snails_AR_Munna Cpp14 0.00s
44 maruf089 Cpp14 0.00s
45 soumitro_cse1604114 Cpp14 0.00s
46 ashish_pondit Cpp 0.00s
47 1604099_ishtiaq Cpp14 0.00s
48 mmm_1604116 Cpp14 0.00s
49 Nusrat_cse16 Cpp14 0.00s
50 shibli1604128 Cpp 0.00s
Feedback