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 Pi, Mirko must provide Ki candy intended for aPokémon of that species. After the evolution of that Pokémon, he gets 2 candies back.Pokémon can evolve only with the help of candy intended for their species.Mirko has N species of Pokémon and Mi candy for Pokémon of species Pi and wants toknow how many total Pokémon he can evolve.He also wants to know which Pokémon can evolve the most number of times. If there aremultiple such Pokémon, output the one with the smallest Pokédex number. In other words,the one that appears earliest in the input data.INPUTThe first line of input contains the integer N (1 ≤ N ≤ 70), the number of Pokémon species.The following 2N lines contains N sets of data, wherein it holds:● line 2i contains string Pi, 20 characters long at most, the name of the ith Pokémonspecies;● line 2i+1 contains integers Ki(12 ≤ Ki ≤ 400) and Mi(1 ≤ Mi ≤ 104 ), the number ofcandy necessary for the evolution of one Pokémon of the ith species and the totalnumber of candy Mirko has for Pokémon of the ith speciesOUTPUTThe 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 mostnumber of times.
đang được dịch, vui lòng đợi..