fn g() -> Vec { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.split_whitespace().flat_map(str::parse).collect() } fn main() { let n = g()[0] as usize; let (mut x, mut y) = (vec![], vec![]); for _ in 0..n { let v = g(); x.push(v[0]); y.push(v[1]); } x.sort(); y.sort(); let a = x.iter().fold(0, |t, u| t + (u - x[n / 2]).abs()) + y.iter().fold(0, |t, v| t + (v - y[n / 2]).abs()); println!("{a}") }