#1261
Unrated
Go
스페셜 저지채점 준비중
시간 제한
1s
메모리 제한
32MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

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 PiP_{i}, Mirko must provide KiK_{i} candy intended for a Poké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 MiM_{i} candy for Pokémon of species PiP_{i} and wants to know 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 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.

입력

The first line of input contains the integer N (1 ≤ N ≤ 70), the number of Pokémon species. The following 2 N lines contains N sets of data, wherein it holds: ● line 2 i contains string PiP_{i}, 20 characters long at most, the name of the i-th Pokémon species; ● line 2 i +1 contains integers KiK_{i} (12 ≤ KiK_{i} ≤400) and MiM_{i} (1 ≤ MiM_{i}10410^{4}), the number of candy necessary for the evolution of one Pokémon of the i-th species and the total number of candy Mirko has for Pokémon of the i-th species

출력

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.

채점

In test cases worth 16 points total, it will hold N = 3. The first line of output will count towards 50% of points for that test case. The second line of output will count towards 50% of points for that test case.

예제 입력 1

4
Caterpie
12 33
Weedle
12 42
Pidgey
12 47
Rattata
25 71

예제 출력 1

14
Weedle

예제 입력 2

7
Bulbasaur
25 74
Ivysaur
100 83
Charmander
25 116
Charmeleon
100 32
Squirtle
25 1
Wartortle
100 173
Pikachu
50 154

예제 출력 2

11
Charmander
코드 제출

이 문제는 현재 제출할 수 없습니다.

이 현상이 잘못되었다고 생각될 경우 관리자한테 문의주세요.

내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.