T = int(input()) for i in range(T): A, B, C = map(int, input().split()) print(A * pow(10, C, 10*B) % (10*B) // B)