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