a=1 for i in range(int(input())): g,d=map(int,input().split());a,s=g/5000-100-d*6,(str(i+1)+'\n')*6 print('NO'if a>=0 else'YES\n'+s[:-1])