#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(non_upper_case_globals)]


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [$t:tt]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}


#[cfg(debug_assertions)]
macro_rules! mydbg {
    //($arg:expr) => (dbg!($arg))
    ($arg:expr) => (println!("{:?}",$arg));
}


#[cfg(not(debug_assertions))]
macro_rules! mydbg {
    ($($arg:expr),*) => {};
}


use std::cmp;
use std::collections::HashMap;
use std::ops::{ Add, Sub , Div , Mul };



#[derive(Debug,Copy,Clone)]
pub struct ComplexNum{
    real :f64,
    imaginary : f64,
}


impl ComplexNum{
    pub fn new (r :f64 , im :f64)-> Self{
        return ComplexNum{real:r , imaginary:im};
    }

    pub fn conjugate(&self)-> Self{
        return ComplexNum::new(self.real , self.imaginary * -1_f64);
    }

    pub fn nearly_equal(&self , other : Self) -> bool{
        let a = 1e-10f64;
        return (self.real - other.real).abs() < a && (self.imaginary - other.imaginary).abs() < a;

    }

    pub fn norm2 (&self ) -> f64{
        return self.real * self.real + self.imaginary * self.imaginary;
    }

    pub fn norm(&self) -> f64{
        return self.norm2().sqrt();
    }
}


impl PartialEq for ComplexNum {
    fn eq(&self, other: &Self) -> bool {
        self.real == other.real && self.imaginary == other.imaginary
    }
}


impl Eq for ComplexNum {}


impl Add for ComplexNum{
    type Output = Self;
    fn add (self , other : Self)-> Self{
        ComplexNum::new(self.real + other.real , self.imaginary + other.imaginary)
    }
}


impl Sub for ComplexNum{
    type Output = Self;
    fn sub (self , other : Self)-> Self{
        ComplexNum::new(self.real - other.real , self.imaginary - other.imaginary)
    }
}


impl Mul for ComplexNum{
    type Output = Self;
    fn mul (self , other : Self)-> Self{
        ComplexNum::new(self.real * other.real - self.imaginary * other.imaginary,
        self.imaginary * other.real + self.real * other.imaginary)
    }
}



pub fn sort_complex_number_with_angle(a : &mut Vec<ComplexNum>) {
    fn orthant (c : &ComplexNum) -> i32{
        if(c.real == 0_f64 && c.imaginary  == 0_f64){
            return 0;
        }
        else if(c.real >= 0_f64 && c.imaginary >= 0_f64){
            return 1;
        }
        else if(c.real <= 0_f64 && c.imaginary >= 0_f64){
            return 2;
        }
        else if(c.real <= 0_f64 && c.imaginary <= 0_f64){
            return 3;
        }
        else {
            return 4;
        }

    }
    
    a.sort_by(| a,b |{
        let a_s = orthant(a);
        let b_s = orthant(b);
        if(a_s != b_s){
            return a_s.cmp(&b_s);
        }
        else if a_s == 0 && b_s == 0 {return std::cmp::Ordering::Equal}
        else{
            let ab = a.conjugate() * *b;
            return if ab.imaginary == 0.0 { std::cmp::Ordering::Equal}
            else if ab.imaginary > 0.0 {std::cmp::Ordering::Less}
            else {std::cmp::Ordering::Greater}
        }
    });
}


fn main() {

    input! { 
       n: usize,
       a : [(i64,i64);n],
    }

    
    
    
    let mut b = vec![ComplexNum::new(0_f64,0_f64);n];
    
    for i in 0..n{
        b[i].real = a[i].0 as f64;
        b[i].imaginary = a[i].1 as f64;
    }
    b.reverse();
    
    sort_complex_number_with_angle(&mut b);
    mydbg!(b);
    let mut result = vec![];

    for i in 0..n{
        let mut tmp = ComplexNum::new(0_f64,0_f64);
        let mut ans = 0_f64;
        for j in 0..n{
            //let k = (j+i)%n;
            let mut k  = j+i;
            if k >= n { k = k-n}
            tmp = tmp + b[k];
            let norm = tmp.norm2();
            if ans <=  norm {
                ans =  norm;
            }
            else {
                break;
            }
        }
        result.push(ans);
    }

    result.sort_by(|a,b|{
        return if a == b {
            std::cmp::Ordering::Equal
        }
        else if a < b{
            std::cmp::Ordering::Less
        }
        else{
           std::cmp::Ordering::Greater
        }
    });

    mydbg!(result);
    
    
    println!("{:.15}",result[n-1].sqrt());


}


Measured memory_bytes: 4352