gets arr = gets.chomp.split.map(&:to_i) if arr.size % 2 == 0 p (arr.sort[arr.size/2-1] + arr.sort[arr.size/2]).to_f / 2 else p arr.sort[arr.size/2].to_f end