I=input for t in[0]*int(I()):N,M,K=map(int,I().split());print("YNeos"[all(k%M or N