#pragma GCC optimize("Ofast") #pragma GCC target("avx2") void*shmat(); void*mmap(); #define RD(v) int v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;} #define RDL(v) long v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;} char wbuf[8*10000]; #define TMAX 1000000000000000l long c[3000][1500]; main(){ c[0][0]=1; for(int i=1;i<3000;++i){ c[i][0]=1; for(int j=1;j<1500;++j){ long x=c[i-1][j-1]+c[i-1][j]; c[i][j]=x<(TMAX+1)?x:(TMAX+1); } } char*rp=mmap(0l,27l*10000+6,1,2,0,0ll); char*wp=wbuf; while(*rp++!=10); do{ RD(d); RD(x); RDL(t); if(c[x+d-1][d-1]>t){ *(long*)wp=0x0a554f425554455al; wp+=8; }else{ *(int*)wp=0x0a4341; wp+=3; } }while(*rp); write(1,wbuf,wp-wbuf); _exit(0); }