#include <bits/stdc++.h>

using namespace std;

random_device rnd;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin >> n;
    vector<pair<int, int>> as;
    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        as.emplace_back(a, b);
    }

    long long ans = 0;
    for (int _ = 0; _ < 10000; _++) {
        shuffle(as.begin(), as.end(), rnd);
        int x = 0, y = 0;
        long long sq = 0;
        vector<pair<int, int>> bs = as;

        auto get = [&](int x, int y) {
            return 1ll * x * x + 1ll * y * y;
        };
        while (1) {
            bool found = false;
            pair<int, int> hoge;
            int idx = 0;
            for (auto &p : bs) {
                int a = p.first, b = p.second;
                if (x + a >= 0 && y + b >= 0 && sq <= get(x + a, y + b)) {
                    x += a;
                    y += b;
                    sq = get(x, y);
                    found = true;
                    hoge = p;
                    break;
                }
                idx++;
            }
            if (found) {
                bs.erase(bs.begin() + idx);
            } else {
                break;
            }
        }
        ans = max(ans, sq);
    }

    for (int _ = 0; _ < 10000; _++) {
        shuffle(as.begin(), as.end(), rnd);
        int x = 0, y = 0;
        long long sq = 0;
        vector<pair<int, int>> bs = as;

        auto get = [&](int x, int y) {
            return 1ll * x * x + 1ll * y * y;
        };
        while (1) {
            bool found = false;
            pair<int, int> hoge;
            int idx = 0;
            for (auto &p : bs) {
                int a = p.first, b = p.second;
                if (x + a >= 0 && y + b <= 0 && sq <= get(x + a, y + b)) {
                    x += a;
                    y += b;
                    sq = get(x, y);
                    found = true;
                    hoge = p;
                    break;
                }
                idx++;
            }
            if (found) {
                bs.erase(bs.begin() + idx);
            } else {
                break;
            }
        }
        ans = max(ans, sq);
    }

    for (int _ = 0; _ < 10000; _++) {
        shuffle(as.begin(), as.end(), rnd);
        int x = 0, y = 0;
        long long sq = 0;
        vector<pair<int, int>> bs = as;

        auto get = [&](int x, int y) {
            return 1ll * x * x + 1ll * y * y;
        };
        while (1) {
            bool found = false;
            pair<int, int> hoge;
            int idx = 0;
            for (auto &p : bs) {
                int a = p.first, b = p.second;
                if (x + a <= 0 && y + b >= 0 && sq <= get(x + a, y + b)) {
                    x += a;
                    y += b;
                    sq = get(x, y);
                    found = true;
                    hoge = p;
                    break;
                }
                idx++;
            }
            if (found) {
                bs.erase(bs.begin() + idx);
            } else {
                break;
            }
        }
        ans = max(ans, sq);
    }

    for (int _ = 0; _ < 10000; _++) {
        shuffle(as.begin(), as.end(), rnd);
        int x = 0, y = 0;
        long long sq = 0;
        vector<pair<int, int>> bs = as;

        auto get = [&](int x, int y) {
            return 1ll * x * x + 1ll * y * y;
        };
        while (1) {
            bool found = false;
            pair<int, int> hoge;
            int idx = 0;
            for (auto &p : bs) {
                int a = p.first, b = p.second;
                if (x + a <= 0 && y + b <= 0 && sq <= get(x + a, y + b)) {
                    x += a;
                    y += b;
                    sq = get(x, y);
                    found = true;
                    hoge = p;
                    break;
                }
                idx++;
            }
            if (found) {
                bs.erase(bs.begin() + idx);
            } else {
                break;
            }
        }
        ans = max(ans, sq);
    }

    printf("%.20f\n", sqrt(ans));
}

Measured memory_bytes: 256