x=gets.to_i y=gets.to_i distance=gets.to_f order=0 def custom_round(num) if num < 1 return 1 else return num.floor end end if x == 0 && y == 0 puts order elsif y == 0 && x > 0 order += 1 puts order + custom_round(x / distance) elsif y == 0 && x < 0 order += 1 puts order + custom_round(x.abs / distance) elsif x == 0 && y > 0 puts order + custom_round(y / distance) elsif x == 0 && y < 0 order += 2 puts order + custom_round(y.abs / distance) elsif x > 0 && y > 0 order += 1 puts order + custom_round(x / distance) + custom_round(y / distance) elsif x < 0 && y > 0 order += 2 puts order + custom_round(x.abs / distance) + custom_round(y / distance) elsif x < 0 && y < 0 order += 2 puts order + custom_round(x.abs / distance) + custom_round(y.abs / distance) elsif x > 0 && y < 0 order += 2 puts order + custom_round(x / distance) + custom_round(y.abs / distance) end