defmodule Main do def main do 1..2 |> Enum.map(fn _ -> IO.read(:line) |> String.split() |> Enum.map(&String.to_integer/1) end) |> solve |> IO.puts() end defp solve([[k, n, _], a]) do r = k * n - (a |> Enum.sum()) cond do r < 0 -> -1 true -> r end end end