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