#! ruby L, K = gets.chomp.split.map(&:to_i) K2 = K * 2 if L < K2 puts 0 else rem = L % K2 yuu = (L - rem) / 2 puts yuu end