T = gets.to_i T.times do a, b, c = gets.chomp.split.map(&:to_i) a *= 10.pow(c - 1, b) a %= b puts (a * 10) / b end