import sys input = sys.stdin.readline T=int(input()) for tests in range(T): A,B,C=map(int,input().split()) k=A*pow(10,C,10*B)%(10*B) print(k//B)