Q = int(input()) for _ in range(Q): x,n,d = list(map(int,input().split())) if(x%2 == 0 and d%2 == 0): print("inf") else: print((x-1)*(x+d-1) - 1)