Mirko quickly got tired of Jetpack Joyride and started playing Pokémon GO! on his phone. One of the curiosities of this game is the so-called evolution of Pokémon.
In order to evolve Pokémon of species
Mirko has
He also wants to know which Pokémon can evolve the most number of times. If there are multiple such Pokémon, output the one with the smallest Pokédex number. In other words, the one that appears earliest in the input data.
Input Specification
The first line of input contains the integer
- Line
contains string , characters long at most, the name of the Pokémon species; - Line
contains integers and , the number of candy necessary for the evolution of one Pokémon of the species and the total number of candy Mirko has for Pokémon of the species.
Output Specification
The first line of output must contain the total number of Pokémon that Mirko can evolve. The second line of output must contain the name of the Pokémon that can evolve the most number of times.
Scoring
In test cases worth
The first line of output will count towards
The second line of output will count towards
Sample Input 1
4
Caterpie
12 33
Weedle
12 42
Pidgey
12 47
Rattata
25 71
Sample Output 1
14
Weedle
Explanation for Sample Output 1
Let's describe how Mirko evolved Weedles. For Weedles' first evolution, Mirko spent
Similarly, we see that Mirko can evolve at most
Out of all Pokémon, Weedle and Pidgey evolved the most number of times, but Weedle's Pokédex number is smaller (it appears earlier in the input data), so it is the solution of the second part of the task.
Sample Input 2
7
Bulbasaur
25 74
Ivysaur
100 83
Charmander
25 116
Charmeleon
100 32
Squirtle
25 1
Wartortle
100 173
Pikachu
50 154
Sample Output 2
11
Charmander
Comments