from math import gcd for _ in range(int(input())): d,x,y = map(int,input().split()) if x