def solve(A,B,C): A*=pow(10,C-1,B) A%=B return (A*10)//B T=int(input()) ans=[0]*T for i in range(T): a,b,c=map(int,input().split()) ans[i]=solve(a,b,c) for i in range(T): print(ans[i])