defmodule Main do def main do n = IO.read(:line) |> String.trim() |> String.to_integer() a = IO.read(:line) |> String.split() |> Enum.map(&String.to_integer/1) |> Enum.sort() solve(n, a) |> IO.puts() end def solve(n, a) do cond do n |> rem(2) == 0 -> ((a |> Enum.at((n |> div(2)) - 1)) + (a |> Enum.at(n |> div(2)))) / 2 true -> a |> Enum.at((n - 1) |> div(2)) end end end