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