defmodule Main do def main do IO.stream(:stdio, :line) |> Enum.take(3) |> Enum.map(&String.trim/1)|> Enum.map(&String.to_integer/1) |> count |> IO.puts end def count([0, 0, _]) do 0 end def count([0, y, l]) when y > 0 do y/l |> abs |> ceil |> trunc end def count([0, y, l]) do y/l |> abs |> ceil |> trunc |> (fn num -> num + 2 end).() end def count([x, 0, l]) do x/l |> abs |> ceil |> trunc |> (fn num -> num + 1 end).() end def count([x, y, l]) do count([0, y, l]) + count([x, 0, l]) + rotate(x,y) end def rotate(_,y) when y > 0 do 0 end def rotate(_,_) do -1 end end