class Yukicoder def initialize n = gets.chomp.to_i m = gets.chomp.to_i puts (n / (1000.0 * m)).floor * 1000 end end Yukicoder.new