T = int(input()) for _ in range(T): a, b, c = map(int, input().split()) x = a * pow(10, c, 10 * b) % (10 * b) print(x // b)