defmodule Main do def input, do: IO.read(:line) |> String.trim def ii, do: input() |> String.to_integer def li, do: input() |> String.split |> Enum.map(&String.to_integer/1) def yn(b), do: IO.puts(if b, do: "Yes", else: "No") @inf 10 ** 9 def main do input() a = li() |> Enum.sort dmin = for [a, b] <- Enum.chunk_every(a, 2, 1), reduce: @inf do d -> min(d, b - a) end dmax = Enum.at(a, -1) - Enum.at(a, 0) IO.puts dmin IO.puts dmax end end