from collections import defaultdict import sys readline=sys.stdin.readline write=sys.stdout.write T=int(readline()) for t in range(T): N,M,K=map(int,readline().split()) if K%M