#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
using namespace std;
int N;
const int B=5000;
int x[2][B],y[2][B];
int main()
{
	cin>>N;
	for(int c=0;c<N;c++)
	{
		int X,Y;cin>>X>>Y;
		for(int i=0;i<B;i++)x[1][i]=x[0][i],y[1][i]=y[0][i];
		if(X||Y)
		{
			for(int i=0;i<B;i++)
			{
				int tx=x[0][i]+X,ty=y[0][i]+Y;
				double theta;
				if(ty==0&&tx<0)theta=M_PI;
				else
				{
					if(ty<0)theta=atan2(ty,tx)+2*M_PI;
					else theta=atan2(ty,tx);
				}
				int id=floor(theta*B/(2*M_PI));
				if(hypot(x[1][id],y[1][id])<hypot(tx,ty))
				{
					x[1][id]=tx;
					y[1][id]=ty;
				}
			}
		}
		for(int i=0;i<B;i++)x[0][i]=x[1][i],y[0][i]=y[1][i];
	}
	double ans=0;
	for(int i=0;i<B;i++)ans=max(ans,hypot(x[0][i],y[0][i]));
	cout<<fixed<<setprecision(16)<<ans<<endl;
}