#include #include #include #define NEEDEXP 3000000 #define DEATHPENALTY 30000 int main() { int dungeon_num; std::cin >> dungeon_num; std::vector efficiency; for (int i = 0; i < dungeon_num; i++) { int exp, death_num; std::cin >> exp >> death_num; efficiency.push_back(exp - DEATHPENALTY * death_num); } std::vector::iterator max = std::max_element(efficiency.begin(), efficiency.end()); if ((*max) * 6 >= NEEDEXP) { std::cout << "YES" << std::endl; int iter = max - efficiency.begin() + 1; //配列の番号を問題に合わせるため + 1 for (int i = 0; i < 6; i++) { std::cout << iter << std::endl; } } else { std::cout << "NO" << std::endl; } return 0; }