defmodule Main do def main do IO.gets("") a = IO.gets("") |> String.trim() |> String.split() |> Enum.map(&String.to_integer(&1)) a |> (&([Enum.slice(&1, 0..-2), Enum.slice(&1, 1..-1)] |> List.zip())).() |> Enum.map(fn {x, y} -> y - x end) |> Enum.min() |> IO.puts() (List.last(a) - List.first(a)) |> IO.puts() end end