#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;

inline unsigned long long xor128() {
    static unsigned long long rx = 123456789, ry = 362436069, rz = 521288629, rw = 88675123;
    unsigned long long rt = (rx ^ (rx << 11));
    rx = ry;
    ry = rz;
    rz = rw;
    return (rw = (rw ^ (rw >> 19)) ^ (rt ^ (rt >> 8)));
}
inline double rand128(double min = 0, double max = 1){
        return (double)(xor128() % 0xFFFF) / 0xFFFF * (max - min) + min;
}



std::chrono::system_clock::time_point start;
std::chrono::system_clock::time_point owari;

double calc_time(){
  owari = std::chrono::system_clock::now();
  double elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(owari-start).count();
  return elapsed;
}

int ok[101];
int ok2[101];
int ok3[101];
int ok4[101];

int used[101];
int ans[101];
int ng[101];

int used2[101];
int ans2[101];
int ng2[101];

int used3[101];
int ans3[101];
int ng3[101];

int used4[101];
int ans4[101];
int ng4[101];

int n;
int x[101];
int y[101];

void sol1(){
	double startTemp=100000;
  	double endTemp=1;
  	double saTimeStart    = calc_time(); 
  	double saTimeEnd      = 499;
  	double TT = saTimeEnd-saTimeStart;
  	double TTT =  (endTemp - startTemp);  
	double elapsed = calc_time();
	double t = elapsed-saTimeStart; 
    double temp = startTemp +TTT * t / TT;
    long long X=0,Y=0;
    r(i,n){
    	if(x[i]>=0 && y[i]>=0){
    		ans[i]=1;
    		used[i]=1;
    		X+=x[i];
    		Y+=y[i];
    		ok[i]=1;
    	}
    	else if( x[i]<=0 && y[i]<=0 ){
    		ng[i]=1;
    	}
    }
    long long cur=0;
    int cnt=0;
	long long MAX=0;
    cur = MAX = X*X+Y*Y;

	while(1){
		if(cnt%20==0){
			elapsed = calc_time();
			t = elapsed-saTimeStart; 
			temp = startTemp +TTT * t / TT;
		}
		if(elapsed>499)break;
		int idx=xor128()%n;
		if(ng[idx]||ok[idx])continue;
		int A=x[idx];
		int B=y[idx];

		if(used[idx]){
			A*=-1;
			B*=-1;
		}

		used[idx]^=1;

		long long sum=((X+A)*(X+A))+((Y+B)*(Y+B));
        double prob = exp(( sqrt(sum)-sqrt(cur) ) / temp);
        bool FORCE_NEXT = prob > (double)rand128(0,1) ;
		if(MAX<sum){
			MAX=sum;
			r(i,n)ans[i]=used[i];
		}
		if(cur<sum || FORCE_NEXT){
			cur = sum;
			X+=A;
			Y+=B;
		}
		else{
			used[idx]^=1;
		}
		cnt++;
	}
	cerr<<MAX<<endl;
}
void sol2(){
	double startTemp=100000;
  	double endTemp=1;
  	double saTimeStart    = calc_time(); 
  	double saTimeEnd      = 999;
  	double TT = saTimeEnd-saTimeStart;
  	double TTT =  (endTemp - startTemp);  
	double elapsed = calc_time();
	double t = elapsed-saTimeStart; 
    double temp = startTemp +TTT * t / TT;
    long long X=0,Y=0;
    r(i,n){
    	if(x[i]>=0 && y[i]<=0){
    		ans2[i]=1;
    		used2[i]=1;
    		X+=x[i];
    		Y+=y[i];
    		ok2[i]=1;
    	}
    	else if( x[i]<=0 && y[i]>=0 ){
    		ng2[i]=1;
    	}
    }
    long long cur=0;
    int cnt=0;
	long long MAX=0;
    cur = MAX = X*X+Y*Y;

	while(1){
		if(cnt%20==0){
			elapsed = calc_time();
			t = elapsed-saTimeStart; 
			temp = startTemp +TTT * t / TT;
		}
		if(elapsed>999)break;
		int idx=xor128()%n;
		if(ng2[idx]||ok2[idx])continue;
		int A=x[idx];
		int B=y[idx];

		if(used2[idx]){
			A*=-1;
			B*=-1;
		}

		used2[idx]^=1;

		long long sum=((X+A)*(X+A))+((Y+B)*(Y+B));
        double prob = exp(( sqrt(sum)-sqrt(cur) ) / temp);
        bool FORCE_NEXT = prob > (double)rand128(0,1) ;
		if(MAX<sum){
			MAX=sum;
			r(i,n)ans2[i]=used2[i];
		}
		if(cur<sum || FORCE_NEXT){
			cur = sum;
			X+=A;
			Y+=B;
		}
		else{
			used2[idx]^=1;
		}
		cnt++;
	}
}
void sol3(){
	double startTemp=100000;
  	double endTemp=1;
  	double saTimeStart    = calc_time(); 
  	double saTimeEnd      = 1499;
  	double TT = saTimeEnd-saTimeStart;
  	double TTT =  (endTemp - startTemp);  
	double elapsed = calc_time();
	double t = elapsed-saTimeStart; 
    double temp = startTemp +TTT * t / TT;
    long long X=0,Y=0;
    r(i,n){
    	if(x[i]<=0 && y[i]>=0){
    		used3[i]=1;
    		ans3[i]=1;
    		X+=x[i];
    		Y+=y[i];
    		ok3[i]=1;
    	}
    	else if( x[i]>=0 && y[i]<=0 ){
    		ng3[i]=1;
    	}
    }
    long long cur=0;
    int cnt=0;
	long long MAX=0;
    cur = MAX = X*X+Y*Y;

	while(1){
		if(cnt%20==0){
			elapsed = calc_time();
			t = elapsed-saTimeStart; 
			temp = startTemp +TTT * t / TT;
		}
		if(elapsed>1499)break;
		int idx=xor128()%n;
		if(ng3[idx]||ok3[idx])continue;
		int A=x[idx];
		int B=y[idx];

		if(used3[idx]){
			A*=-1;
			B*=-1;
		}

		used3[idx]^=1;

		long long sum=((X+A)*(X+A))+((Y+B)*(Y+B));
        double prob = exp(( sqrt(sum)-sqrt(cur) ) / temp);
        bool FORCE_NEXT = prob > (double)rand128(0,1) ;
		if(MAX<sum){
			MAX=sum;
			r(i,n)ans3[i]=used3[i];
		}
		if(cur<sum || FORCE_NEXT){
			cur = sum;
			X+=A;
			Y+=B;
		}
		else{
			used3[idx]^=1;
		}
		cnt++;
	}
	cerr<<cnt<<endl;
}
void sol4(){
	double startTemp=100000;
  	double endTemp=1;
  	double saTimeStart    = calc_time(); 
  	double saTimeEnd      = 1998;
  	double TT = saTimeEnd-saTimeStart;
  	double TTT =  (endTemp - startTemp);  
	double elapsed = calc_time();
	double t = elapsed-saTimeStart; 
    double temp = startTemp +TTT * t / TT;
    long long X=0,Y=0;
    r(i,n){
    	if(x[i]<=0 && y[i]<=0){
    		used4[i]=1;
    		ans4[i]=1;
    		X+=x[i];
    		Y+=y[i];
    		ok4[i]=1;
    	}
    	else if( x[i]>=0 && y[i]>=0 ){
    		ng4[i]=1;
    	}
    }
    long long cur=0;
    int cnt=0;
	long long MAX=0;
    cur = MAX = X*X+Y*Y;

	while(1){
		if(cnt%20==0){
			elapsed = calc_time();
			t = elapsed-saTimeStart; 
			temp = startTemp +TTT * t / TT;
		}
		if(elapsed>1998)break;
		int idx=xor128()%n;
		if(ng4[idx]||ok4[idx])continue;
		int A=x[idx];
		int B=y[idx];

		if(used4[idx]){
			A*=-1;
			B*=-1;
		}

		used4[idx]^=1;

		long long sum=((X+A)*(X+A))+((Y+B)*(Y+B));
        double prob = exp(( sqrt(sum)-sqrt(cur) ) / temp);
        bool FORCE_NEXT = prob > (double)rand128(0,1) ;
		if(MAX<sum){
			MAX=sum;
			r(i,n)ans4[i]=used4[i];
		}
		if(cur<sum || FORCE_NEXT){
			cur = sum;
			X+=A;
			Y+=B;
		}
		else{
			used4[idx]^=1;
		}
		cnt++;
	}
}

int main(){
	start = std::chrono::system_clock::now();

	cin>>n;
	r(i,n)cin>>x[i]>>y[i];

	sol1();
	sol2();
	sol3();
	sol4();


	//cerr<<cnt<<endl;

	double MAX=0;
	{
		double Xa=0,Ya=0;
		r(i,n)if(ans[i])Xa+=x[i],Ya+=y[i];
		MAX=max(MAX,sqrt(Xa*Xa+Ya*Ya));
	}
	{
		double Xa=0,Ya=0;
		r(i,n)if(ans2[i])Xa+=x[i],Ya+=y[i];
		MAX=max(MAX,sqrt(Xa*Xa+Ya*Ya));
	}
	{
		double Xa=0,Ya=0;
		r(i,n)if(ans3[i])Xa+=x[i],Ya+=y[i];
		MAX=max(MAX,sqrt(Xa*Xa+Ya*Ya));
	}
	{
		double Xa=0,Ya=0;
		r(i,n)if(ans4[i])Xa+=x[i],Ya+=y[i];
		MAX=max(MAX,sqrt(Xa*Xa+Ya*Ya));
	}
	//cout<<Xa<<' '<<Ya<<endl;

	printf("%.12f\n",MAX);
}

Measured memory_bytes: 512