defmodule Main do def main do IO.read(:line) |> String.split() |> Enum.map(&String.to_integer/1) |> solve |> IO.puts() end def solve([l, k]) do s = l |> rem(2 * k) (((l - s) |> div(2)) - cond do s == 0 -> 1 true -> 0 end) |> (&(&1 - (&1 |> rem(k)))).() end end