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