defmodule Main do def main do 1..3 |> Enum.map(fn _ -> IO.read(:line) |> String.trim() |> String.to_integer() end) |> solve |> IO.puts() end defp solve([x, y, l]) do (cond do y < 0 -> 2 x == 0 -> 0 true -> 1 end + cond do y == 0 -> 0 true -> (abs(y) / l) |> Float.ceil() end + cond do x == 0 -> 0 true -> (abs(x) / l) |> Float.ceil() end) |> trunc end end