#include #include using namespace std; int main(int argc, const char* argv[]) { int N; cin >> N; int G[N], D[N]; int EXP[N]; for (int i = 0; i < N; i++) { cin >> G[i]; cin >> D[i]; EXP[i] = G[i] - 30000 * D[i]; } auto maxExpp = max_element(EXP, &EXP[N]); size_t maxIndex = distance(EXP, maxExpp); bool ret = 3000000 <= *maxExpp * 6; cout << (ret ? "YES" : "NO") << endl; if (!ret) return 0; for (int i = 0; i < 6; i++) { cout << maxIndex + 1 << endl; } return 0; }