X=gets.chomp.to_i Y=gets.chomp.to_i L=gets.chomp.to_i def robot(x, y, distance) m = ((x - 0).abs.to_f / distance).ceil n = ((y - 0).abs.to_f / distance).ceil r = 0 if m > 0 and n > 0 r = 1 end return m + n + r end puts robot(X, Y, L)