#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
#include <iostream>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <fstream>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <climits>
#include <memory>
#include <cstring>
#include <immintrin.h>
#ifdef _MSC_VER
#include <ppl.h>
#endif



using namespace std;

//呪文
#define DUMPOUT std::cerr
#define dump(...) DUMPOUT<<"  ";DUMPOUT<<#__VA_ARGS__<<" :["<<__LINE__<<":"<<__FUNCTION__<<"]"<<std::endl;DUMPOUT<<"    ";dump_func(__VA_ARGS__)

typedef unsigned uint; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<double, double> pdd; typedef pair<string, string> pss;
template <typename _KTy, typename _Ty> ostream& operator << (ostream& o, const pair<_KTy, _Ty>& m) { o << "{" << m.first << ", " << m.second << "}"; return o; }
template <typename _KTy, typename _Ty> ostream& operator << (ostream& o, const map<_KTy, _Ty>& m) { if(m.empty()) { o << "{ }"; return o; } o << "{" << *m.begin(); for(auto itr = ++m.begin(); itr != m.end(); itr++) { o << ", " << *itr; } o << "}"; return o; }
template <typename _KTy, typename _Ty> ostream& operator << (ostream& o, const unordered_map<_KTy, _Ty>& m) { if(m.empty()) { o << "{ }"; return o; } o << "{" << *m.begin(); for(auto itr = ++m.begin(); itr != m.end(); itr++) { o << ", " << *itr; } o << "}"; return o; }
template <typename _Ty> ostream& operator << (ostream& o, const vector<_Ty>& v) { if(v.empty()) { o << "{ }"; return o; } o << "{" << v.front(); for(auto itr = ++v.begin(); itr != v.end(); itr++) { o << ", " << *itr; } o << "}"; return o; }
template <typename _Ty> ostream& operator << (ostream& o, const set<_Ty>& s) { if(s.empty()) { o << "{ }"; return o; } o << "{" << *(s.begin()); for(auto itr = ++s.begin(); itr != s.end(); itr++) { o << ", " << *itr; } o << "}"; return o; }
template <typename _Ty> ostream& operator << (ostream& o, const unordered_set<_Ty>& s) { if(s.empty()) { o << "{ }"; return o; } o << "{" << *(s.begin()); for(auto itr = ++s.begin(); itr != s.end(); itr++) { o << ", " << *itr; }	o << "}"; return o; }
template <typename _Ty> ostream& operator << (ostream& o, const stack<_Ty>& s) { if(s.empty()) { o << "{ }"; return o; } stack<_Ty> t(s); o << "{" << t.top(); t.pop(); while(!t.empty()) { o << ", " << t.top(); t.pop(); } o << "}";	return o; }
template <typename _Ty> ostream& operator << (ostream& o, const list<_Ty>& l) { if(l.empty()) { o << "{ }"; return o; } o << "{" << l.front(); for(auto itr = ++l.begin(); itr != l.end(); ++itr) { o << ", " << *itr; } o << "}"; return o; }
template <typename _KTy, typename _Ty> istream& operator >> (istream& is, pair<_KTy, _Ty>& m) { is >> m.first >> m.second; return is; }
template <typename _Ty> istream& operator >> (istream& is, vector<_Ty>& v) { for(size_t i = 0; i < v.size(); i++) is >> v[i]; return is; }
namespace aux { // print tuple
  template<typename Ty, unsigned N, unsigned L> struct tp { static void print(ostream& os, const Ty& v) { os << get<N>(v) << ", "; tp<Ty, N + 1, L>::print(os, v); } };
  template<typename Ty, unsigned N> struct tp<Ty, N, N> { static void print(ostream& os, const Ty& v) { os << get<N>(v); } };
}
template<typename... Tys> ostream& operator<<(ostream& os, const tuple<Tys...>& t) { os << "{"; aux::tp<tuple<Tys...>, 0, sizeof...(Tys) - 1>::print(os, t); os << "}"; return os; }

template<typename A, size_t N, typename T> inline void Fill(A(&array)[N], const T &val) { std::fill((T*)array, (T*)(array + N), val); }

void dump_func() { DUMPOUT << std::endl; }
template <class Head, class... Tail> void dump_func(Head&& head, Tail&&... tail) { DUMPOUT << head; if(sizeof...(Tail) == 0) { DUMPOUT << " "; } else { DUMPOUT << ", "; } dump_func(std::move(tail)...); }

template<typename Ty>Ty modpow(Ty n, Ty e, Ty m) { Ty result = 1; while(e > 0) { if(e & 1)result = (result*n) % m; e >>= 1; n = (n*n) % m; }return result; }



#define PI 3.14159265358979323846
#define EPS 1e-10
#define FOR(i,a,n) for(int i=(a);i<(n);++i)
#define REP(i,n)  FOR(i,0,n)
#define all(j) (j).begin(), (j).end()
#define SZ(j) ((int)(j).size())
#define fake false

class timer {
public:
  double t = 0;
  timer() {}
  void measure() {
    t = time() - t;
  }
  static double time() {
#ifdef _MSC_VER
    return __rdtsc() / 2.8e9;
#else
    unsigned long long a, d;
    __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
    return (d << 32 | a) / 2.8e9;
#endif
  }
} timer;

struct SXor128 {
  unsigned x, y, z, w;
  SXor128() { x = 123456789; y = 362436069; z = 521288629; w = 88675123; }
  SXor128(int _w) { x = 123456789; y = 362436069; z = 521288629; w = _w; }
  void setSeed() { x = 123456789; y = 362436069; z = 521288629; w = 88675123; }
  void setSeed(int _w) { x = 123456789; y = 362436069; z = 521288629; w = _w; }
  unsigned nextUInt() {
    unsigned t = (x ^ (x << 11));
    x = y; y = z; z = w;
    return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
  }
  unsigned nextUInt(unsigned mod) {
    unsigned t = (x ^ (x << 11));
    x = y; y = z; z = w;
    w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
    return w % mod;
  }
  unsigned nextUInt(unsigned l, unsigned r) {
    unsigned t = (x ^ (x << 11));
    x = y; y = z; z = w;
    w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
    return w % (r - l + 1) + l;
  }
  double nextDouble() {
    return double(nextUInt()) / UINT_MAX;
  }
} rnd;



int N;
vector<ll> x, y;

struct State {
  vector<bool> used;
  ll sx, sy;
  ll score;
  State(int N) : used(N, false), sx(0), sy(0), score(0) {}

  string toString() const {
    string u(N, ' ');
    REP(i, N) u[i] = used[i] ? '1' : '0';
    return u + " " + to_string(sx) + " " + to_string(sy) + " " + to_string(score);
  }
};
ostream& operator<<(ostream& os, const State& s) {
  os << s.toString();
  return os;
}

vector<State> getAllNextStates(const State& state) {
  vector<State> ret;
  for(int i = 0; i < N; i++) if(!state.used[i]) {
    State s(state);
    s.used[i] = true;
    s.sx += x[i];
    s.sy += y[i];
    s.score = s.sx * s.sx + s.sy * s.sy;
    ret.push_back(s);
  }
  return ret;
}

struct Cmp {
  bool operator() (const State& s1, const State& s2) {
    return s1.score < s2.score;
  }
};

ll bestScore = 0;
unordered_set<vector<bool>> hashes;

void beamSearch(State firstState) {
  using Heap = priority_queue<State, vector<State>, Cmp>;
  Heap nowStates;
  nowStates.push(firstState);

  int width = 100;
  for(int t = 0; t < N; t++) {
    Heap nextStates;
    for(int i = 0; i < width; i++) {
      if(nowStates.empty()) break;
      State nowState = nowStates.top(); nowStates.pop();
      for(auto& nextState : getAllNextStates(nowState)) {
        if(hashes.find(nextState.used) == hashes.end()) {
          hashes.insert(nextState.used);
          nextStates.push(nextState);
        }
      }
    }
    nowStates = nextStates;
    //cerr << "turn: " << t << endl;
    //while(!nextStates.empty()) {
    //  cerr << nextStates.top() << endl;
    //  nextStates.pop();
    //}
    //cerr << t << ": " << nowStates.size() << endl;
    bestScore = max(bestScore, nowStates.top().score);
  }
}

double getTemp(double startTemp, double endTemp, double t, double T, double deg = 1.0) {
  return endTemp + (startTemp - endTemp) * pow((T - t) / T, deg);
}

void SA() {
  bool used[100] ={};

  ll sx = 0, sy = 0;
  ll sxy = 0;
  ll ans = 0;

  double start = timer.time() - timer.t;
  double T =  1.9 - start;
  const unsigned RR = (1 << 30), mask = (1 << 30) - 1;
  while(timer.time() - timer.t - start < T) {
    int i = rnd.nextUInt(N);
    ll diff;
    if(used[i]) {
      diff = (sx - x[i]) * (sx - x[i]) + (sy - y[i]) * (sy - y[i]) - sxy;
    }
    else {
      diff = (sx + x[i]) * (sx + x[i]) + (sy + y[i]) * (sy + y[i]) - sxy;
    }

    double logdiff = (diff < 0 ? -1.0 : 1.0) * log(abs(diff) + 1);
    double temp = getTemp(30, 10, timer.time() - timer.t - start, T);
    double prob = exp(logdiff / temp);

    if(RR * prob > (rnd.nextUInt() & mask)) {
      if(used[i]) {
        sx -= x[i]; sy -= y[i];
        sxy += diff;
        used[i] = false;
      }
      else{
        sx += x[i]; sy += y[i];
        sxy += diff;
        used[i] = true;
      }
    }

    if(sxy > ans) {
      ans = sxy;
    }
  }

  bestScore = max(ans, bestScore);
}

int main() {
  timer.measure();

  //cin.tie(0);
  //ios::sync_with_stdio(false);

  cin >> N;
  x.resize(N);
  y.resize(N);
  REP(i, N) cin >> x[i] >> y[i];

  //N = 100;
  //REP(i, N){
  //  x.push_back((int)rnd.nextUInt(2000001) - 1000000);
  //  y.push_back((int)rnd.nextUInt(2000001) - 1000000);
  //}

  State firstState(N);
  beamSearch(firstState);

  SA();

  printf("%.15f\n", sqrt(bestScore));

  //dump(timer.time() - timer.t);

  return 0;
}


Measured memory_bytes: 49588