import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.string;

void main() {
    auto N = readln.chomp.to!int;
    auto A = iota(N).map!(_ => readln.split.map!(to!long).array).array;

    real angle(const long[] a) {
        return acos(1.0L * a[0] / sqrt(1.0L * a[0]^^2 + a[1]^^2));
    }

    long ans = 0;
    A.sort!((a,b)=>angle(a)<angle(b));

    foreach (len; 1..N+1) foreach (i; 0..N) {
        long x = 0;
        long y = 0;
        foreach (j; i..i+len) {
            int idx = j % N;
            x += A[idx][0];
            y += A[idx][1];
        }
        ans = max(ans, x*x+y*y);
    }

    writefln("%.15f", sqrt(1.0L*ans));
}

