410067: GYM103937 B Extravagant Elephants

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

B. Extravagant Elephantstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

The Robotics & Automation Society (RAS) is sending robot elephants to the moon! But as we all know, robotics is trivial, but robotic elephant analysis is not.

There are $$$n$$$ robot elephant candidates to be sent to the moon. Each elephant has a name $$$s$$$, a complexity rating $$$c$$$, and a mass $$$m$$$. An elephant's extravagance is defined as $$$|s| \cdot c$$$, the product of the length of its name and its complexity rating.

RAS is capable of sending whichever elephant they'd like to the moon. However, they realized that if an elephant has strictly more mass than the moon itself, then they'll end up with a moon on the elephant, and not an elephant on the moon!

Clearly, RAS wants to maximize the extravagance of the robot elephant it sends to the moon, without altering the structure of the solar system. Can you help RAS send robot elephants to the moon?

Input

The first line of input contains two integers, $$$n$$$ ($$$1 \leq n \leq 1000$$$) and $$$M$$$ ($$$1 \leq M \leq 10^6$$$), representing the number of elephants and the mass of the moon, respectively.

Then, $$$n$$$ lines follow, where the $$$i$$$th line describes the $$$i$$$th elephant. Each of these lines contain a string $$$s$$$ ($$$|s| \leq 20$$$), and two integers $$$c$$$ and $$$m$$$ ($$$1 \leq c, m, \leq 10^6$$$). $$$s$$$ represents the name of the elephant and only contains non-whitespace characters, $$$c$$$ represents the complexity rating of the elephant, and $$$m$$$ is the mass of the elephant. All names are unique.

Output

Print "[name] to the moon!", where [name] is the name of the most extravagant elephant that RAS can send to the moon. If there are multiple suitable elephants with the same extravagance, pick the one that appears first in the input.

If RAS cannot send any elephants to the moon, print "dead meme :(".

ExampleInput
3 100
Squidward 5 10
$GME 100 99
PinkPrincess 1000 1000
Output
$GME to the moon!

加入题单

算法标签: