# frozen_string_literal: true

a = gets.to_i
arry = gets.split(' ').map(&:to_i)
arry.sort!
skip = true
memo = arry.each_with_index.inject(0.0) do |memo, (e, i)|
  if i == 0
    memo = (e.to_f + arry[i+1].to_f) / 2.0
    memo
  elsif i == arry.size - 1 && !skip
    (memo.to_f + e.to_f) / 2.0
  elsif !skip
    skip = true
    memo = (memo.to_f + arry[i+1].to_f) / 2.0
    memo
  else
    skip = false
    memo
  end
end

puts memo
