#![allow(unused_imports)]
#![allow(unused_macros)]
use itertools::Itertools;
use num::complex::Complex;
use std::cmp::{max, min};
use std::collections::*;
use std::i64;
use std::io::{stdin, Read};
use std::usize;

trait ChMinMax {
    fn chmin(&mut self, other: Self);
    fn chmax(&mut self, other: Self);
}
impl<T> ChMinMax for T
where
    T: PartialOrd,
{
    fn chmin(&mut self, other: Self) {
        if *self > other {
            *self = other
        }
    }
    fn chmax(&mut self, other: Self) {
        if *self < other {
            *self = other
        }
    }
}

#[allow(unused_macros)]
macro_rules! parse {
    ($it: ident ) => {};
    ($it: ident, ) => {};
    ($it: ident, $var:ident : $t:tt $($r:tt)*) => {
        let $var = parse_val!($it, $t);
        parse!($it $($r)*);
    };
    ($it: ident, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = parse_val!($it, $t);
        parse!($it $($r)*);
    };
    ($it: ident, $var:ident $($r:tt)*) => {
        let $var = parse_val!($it, usize);
        parse!($it $($r)*);
    };
}

#[allow(unused_macros)]
macro_rules! parse_val {
    ($it: ident, [$t:tt; $len:expr]) => {
        (0..$len).map(|_| parse_val!($it, $t)).collect::<Vec<_>>();
    };
    ($it: ident, ($($t: tt),*)) => {
        ($(parse_val!($it, $t)),*)
    };
    ($it: ident, u1) => {
        $it.next().unwrap().parse::<usize>().unwrap() -1
    };
    ($it: ident, $t: ty) => {
        $it.next().unwrap().parse::<$t>().unwrap()
    };
}

fn solve(s: &str) {
    let mut it = s.split_whitespace();
    parse!(it, n: usize);
    let mut xs = vec![];
    for _ in 0..n {
        parse!(it, x: i64, y: i64);
        if x != 0 || y != 0 {
            xs.push(Complex::new(x, y));
        }
    }
    use std::cmp::Ordering::*;
    let cross = |a: Complex<i64>, b: Complex<i64>| a.re * b.im - a.im * b.re;
    let argcmp = |a: &Complex<i64>, b: &Complex<i64>| {
        let a = *a;
        let b = *b;
        let c = cross(a, b);
        if c == 0 {
            if a.re * b.re + a.im * b.im < 0 {
                Less
            } else {
                Equal
            }
        } else {
            if a.im >= 0 {
                if c < 0 && b.im >= 0 {
                    Greater
                } else {
                    Less
                }
            } else {
                if c > 0 && b.im < 0 {
                    Less
                } else {
                    Greater
                }
            }
        }
    };
    let argcmp2 = |a: &Complex<i64>, b: &Complex<i64>| {
        let a = Complex {
            re: a.re as f64,
            im: a.im as f64,
        };
        let b = Complex {
            re: b.re as f64,
            im: b.im as f64,
        };
        a.arg().partial_cmp(&b.arg()).unwrap()
    };
    xs.sort_by(argcmp2);
    let n = xs.len();
    let mut ret = xs.iter().cloned().sum::<Complex<i64>>().norm_sqr();
    for l in 0..n {
        for r in l..=n {
            ret.chmax(xs[l..r].iter().cloned().sum::<Complex<i64>>().norm_sqr());
            if r < n {
                ret.chmax(
                    xs[..l]
                        .iter()
                        .chain(xs[r..].iter())
                        .cloned()
                        .sum::<Complex<_>>()
                        .norm_sqr(),
                );
            } else {
                ret.chmax(xs[..l].iter().cloned().sum::<Complex<i64>>().norm_sqr());
            }
        }
    }
    println!("{}", (ret as f64).sqrt());
}

fn main() {
    let mut s = String::new();
    stdin().read_to_string(&mut s).unwrap();
    solve(&s);
}

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_input() {
        let s = "
        ";
        solve(s);
    }
}


Measured memory_bytes: 3000