Scanf.scanf "%d" (fun n ->
    let xy = Array.init n (fun _ -> Scanf.scanf " %d %d" (fun x y -> x, y)) in
    Array.sort (fun (x0, y0) (x1, y1) ->
        compare (atan2 (float y0) (float x0)) (atan2 (float y1) (float x1))) xy;
    let sum = Array.make (n + 1) (0, 0) in
    for i = 1 to n do
        let (x, y) = sum.(i - 1) in
        let (vx, vy) = xy.(i - 1) in
        sum.(i) <- x + vx, y + vy
    done;
    let rec loop0 i acc =
        let rec loop1 j acc =
            if j = n + 1 then loop0 (i + 1) acc else
                let (x0, y0) = sum.(i) in
                let (x1, y1) = sum.(j) in
                let x = x1 - x0 in
                let y = y1 - y0 in
                let acc = max acc (x * x + y * y) in
                loop1 (j + 1) acc
        in
        if i = n then float acc |> sqrt else loop1 (i + 1) acc
    in
    loop0 0 0 |> Printf.printf "%.10f\n"
)