num = gets.to_i num_array = [] num_array = gets.split.map(&:to_i) num_array.sort! if num_array.length.odd? puts num_array[num_array.length - 2] else puts (num_array[num_array.length/2] + num_array[num_array.length/2 - 1]) / 2.0 end