The Tallest Student
Time limit1sMemory limit256 MB
Print the name of the tallest student in each test case, listing every tied name in input order.
- Level
Easy1 of 10
- Topics
- Implementation
- Solved
- No attempts yet
Problem
Minwoo has been competitive since his school days. When the class runs, he wants to know who is fastest, and when the class takes an exam, he wants to know who scored highest. The class just measured everyone's height, so now Minwoo wants to know who is tallest. Help him find the tallest student.
Input
The input holds several test cases.
The first line of each test case has the number of students (). Each of the next lines has one student's name and height, separated by a single space. A name uses uppercase and lowercase letters only and is at most 10 characters long. A height is given with exactly two digits after the decimal point.
When is 0, the input is over and the program stops.
Output
For each test case, print the name of the tallest student on one line. If several students share the greatest height, print all of them. Separate the names with a single space and keep the order in which they appear in the input.