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