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