import sys input=sys.stdin.readline write=sys.stdout.write T=int(input()) Ans=[0]*T for t in range(T): N,M,K=map(int,input().split()) if K%M