use std::io::{self, BufReader, BufWriter, Read, Write}; fn main() { let stdin = io::stdin(); let mut stdin = BufReader::new(stdin.lock()); let stdout = io::stdout(); let mut stdout = BufWriter::new(stdout.lock()); let n = read_usize(&mut stdin); let mut a: Vec = (0..n).map(|_| read_i32(&mut stdin)).collect(); a.sort(); if n % 2 == 0 { let i = n / 2; let avg = (a[i - 1] + a[i]) as f64 / 2.0; writeln!(&mut stdout, "{}", avg).unwrap(); } else { writeln!(&mut stdout, "{}", a[n / 2]).unwrap(); } } fn read_usize(reader: &mut R) -> usize { reader .bytes() .filter_map(|b| b.ok()) .skip_while(|b| b.is_ascii_whitespace()) .take_while(|b| !b.is_ascii_whitespace()) .map(|b| b as usize - 48) .fold(0, |acc, x| acc * 10 + x) } fn read_i32(reader: &mut R) -> i32 { let mut iter = reader .bytes() .filter_map(|b| b.ok()) .skip_while(|b| b.is_ascii_whitespace()) .take_while(|b| !b.is_ascii_whitespace()); let buf = iter.next().unwrap(); if buf == b'-' { iter.map(|b| b as i32 - 48).fold(0, |acc, x| acc * 10 - x) } else { iter.map(|b| b as i32 - 48) .fold(buf as i32 - 48, |acc, x| acc * 10 + x) } }