T=int(input()) for _ in range(T): N,P,K=map(int,input().split()) cnt=N//5 if cnt==0 and K>0:print("No") elif cnt>0 and (cnt*P)%K==0:print("Yes") else:print("No")