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