-->
当前位置:首页 > 题库

PROGRAMMING:The end of the world

Luz5年前 (2021-05-10)题库416
Well, there was a big explosion. As a result, the whole world came to an end. You became a zombie due to radiation. Of course, because of the big explosion, the ground was full of broken meat. Because you were too weak, you could only climb once and for only 30 seconds to find meat. Now, with your brain not completely lost, think about how to find more meat to eat.
###Input format:
There are several groups of test data, which are processed to the end of the file. Each group input a positive integer n no more than 30, followed by N groups of data, m, t, representing the size of the meat and the time to find the meat.
###Output format:
Each group outputs the largest piece of meat that can be found in 30 seconds. If a piece of meat cannot be found, it outputs "GG". If it is found, it outputs the size of the meat and the time to find it. If you have two pieces of meat of the same size, you should choose the one that takes less time.
###Input example:
Here is a set of inputs. For example:
```in
five
98 3
50 29
24 20
45 45
10 1
two
41 67
77 32
```
###Output example:
The corresponding output is given here. For example:
```out
98 3
GG
```







answer:If there is no answer, please comment