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