defmodule Main do def nStep(step, goal), do: nStep(step, goal, step) defp nStep(step, goal, acc) do cond do acc >= goal -> div(acc, step) true -> nStep(step, goal, acc + step) end end def main do inputs = IO.binread(:all) |> String.split [a, b] = inputs |> Enum.map(&(String.to_integer(&1))) IO.puts nStep(a, b) end end