#include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef ONLINE_JUDGE //POJ # include # include # include # define mkt make_tuple # define empb emplace_back #endif #ifdef _LOCAL # include "for_local.h" #endif using namespace std; typedef unsigned int uint; typedef long long ll; typedef unsigned long long ull; #define repi(_I, _B, _E) for(int _I = (_B); (_I) < (_E); ++ (_I)) #define rep(_I, _N) for(int _I = 0; (_I) < (_N); ++ (_I)) #define mkp make_pair #define all(_X) (_X).begin(), (_X).end() int val[1000]; int dun[6]; int const Need = 3000000; int const Penalty = Need/100; signed main() { int n; cin >> n; rep(i, n) { int g, d; cin >> g >> d; val[i] = g - Penalty * d; } int maxval = *max_element(val, val+n); bool const ok = (val[0] * 6 >= Need); if ( ok ) { cout << "YES" << endl; rep(i, 6) { cout << 1 << endl; } } else { cout << "NO" << endl; } return 0; }