i,t,p=input,int,print for x in range(1,t(i())+1): G,D=i().split() if t(G)>=10000*(50+3*t(D)):p('YES'+'\n%d'%x*6);break else:p('NO')