def main():
    n=int(input())
    for i in range(n):
        li=list(int(i) for i in input().strip().split(' '))
        P=li[0]
        N=li[1]
        D=li[2]
        for i in range(D-1):
            mul=(D-1)*N
            ans=mul+P
        
      
    
        main()