// 35/40 #include #define MOD 1000000007 //#define MOD 998244353 #define INF 1000000000 #define LINF 1000000000000000000 #define rep(i,n) for(int i=0;i; using VI=vector; using VVI=vector; using VVVI=vector; using VL=vector; using VVL=vector; using VVVL=vector; using VB=vector; using VVB=vector; using VP=vector

; using VVP=vector; using VS=vector; const int dx[]={0,-1,1,0},dy[]={-1,0,0,1}; //const int dx[]={-1,0,1,-1,1,-1,0,1},dy[]={-1,-1,-1,0,0,1,1,1}; templatebool chmax(T &a,const T &b){if(abool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;} templateT eucld(T a,T b){if(a0){if(k&1)r=r*a%m;a=a*a%m;k>>=1;}return r;} struct UnionFind{VI v;UnionFind(int n):v(n){rep(i,n)v[i]=i;}int root(int x){if(v[x]==x)return x;return v[x]=root(v[x]);}void unite(int x,int y){int a=root(x),b=root(y);if(a!=b)v[a]=b;}bool same(int x,int y){return root(x)==root(y);}}; int main(void) { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(7); int n; cin >> n; VP a(n); rep(i,n) { int g,d; cin >> g >> d; a[i].FS=g-30000*d; a[i].SD=i+1; } sort(ALL(a),greater

{}); if(a[0].FS*6<3000000) cout << "NO" << endl; else { cout << "YES" << endl; ll sum=a[0].FS*6; VI ans; for(auto i:a) { if(sum-(a[0].FS-i.FS)>=3000000) { ans.PB(i.SD); sum-=a[0].FS-i.FS; } } rep(i,6) { if(i