stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<cmath>

#include<math.h>

#include<ctype.h>

#include<algorithm>

#include<bitset>

#include<cassert>

#include<cctype>

#include<cerrno>

#include<cfloat>

#include<ciso646>

#include<climits>

#include<clocale>

#include<complex>

#include<csetjmp>

#include<csignal>

#include<cstdarg>

#include<cstddef>

#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<ctime>

#include<cwchar>

#include<cwctype>

#include<deque>

#include<exception>

#include<fstream>

#include<functional>

#include<iomanip>

#include<ios>

#include<iosfwd>

#include<iostream>

#include<istream>

#include<iterator>

#include<limits>

#include<list>

#include<locale>

#include<map>

#include<memory>

#include<new>

#include<numeric>

#include<ostream>

#include<queue>

#include<set>

#include<sstream>

#include<stack>

#include<stdexcept>

#include<streambuf>

#include<string>

#include<typeinfo>

#include<utility>

#include<valarray>

#include<vector>

#include<string.h>

#include<stdlib.h>

#include<stdio.h>

using namespace std;

int n,a[100010];

int gcd(int x,int y)

{

	if (!y)

	{

		return x;

	}

	else

	{

		return gcd(y,x%y);

	}

}

bool nim()

{

	long long s=0;

	bool f=false;

	int cnt=0;

	for (int i=1;i<=n;i++)

	{

		s+=a[i]-1;

		if (a[i]==1)

		{

			f=true;

		}

		if (a[i]&1)

		{

			cnt++;

		}

	}

	if (f)

	{

		return s%2;

	}

	if ((n-cnt)%2)

	{

		return true;

	}

	if (cnt==1)

	{

		for (int i=1;i<=n;i++)

		{

			if (a[i]&1)

			{

				a[i]--;

				break;

			}

		}

		int g=a[1];

		for (int i=2;i<=n;i++)

		{

			g=gcd(g,a[i]);

		}

		for (int i=1;i<=n;i++)

		{

			a[i]/=g;

		}

		return !(nim());

	}

	return false;

}

int main()

{

	scanf("%d",&n);

	for (int i=1;i<=n;i++)

	{

		scanf("%d",&a[i]);

	}

	if (nim())

	{

		puts("First");

	}

	else

	{

		puts("Second");

	}

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstring>

#include<cmath>

#include<cstdio>

#include<algorithm>

using namespace std;

int a[100010],n;

inline int read(void)

{

	int x=0,f=1;

     char ch=getchar();

     while(ch>'9'||ch<'0'){

       if(ch=='-') f=-1;

       ch=getchar(); }

     while(ch>='0'&&ch<='9'){

       x=x*10+ch-'0';

       ch=getchar();}

     return x*f;

}

int gcd(int a,int b)

{

     return (b==0)?a:gcd(b,a%b);

}

bool pd()

{

	 long long sum=0;

	 int ex=0,tot=0;

	 for(int i=1;i<=n;++i)

	 {

			sum+=a[i]-1;

			if(a[i]&1) tot++;

			if(a[i]==1) ex=1;

	 }

	 if(ex) return sum%2;

	 if((n-tot)%2) return 1;

	 if(tot==1)

	 {

			int g=0;

			for(int i=1;i<=n;++i) if(a[i]&1) a[i]--;

			for(int i=1;i<=n;++i) g=gcd(g,a[i]);

			for(int i=1;i<=n;++i) a[i]/=g;

			return pd()^1;

	 }

	 return 0;

}

int main()

{

	n=read();

	for(int i=1;i<=n;++i) a[i]=read();

	if(pd()) puts("First");

 	else puts("Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

using namespace std;

int n,a[100001],odd,sum;

int gcd(int x,int y){

	if (!y) return x;

	return gcd(y,x%y);

}

int f(){

	int o=0,e=0,i,g;

	for (i=1;i<=n;++i)

		if (a[i]&1){

			++o;

			odd=i;

		}else ++e;

	if (o==1&&a[odd]!=1){

		--a[odd];

		g=a[1];

		for (i=2;i<=n;++i) g=gcd(g,a[i]);

		for (i=1;i<=n;++i) a[i]/=g;

		return 1-f();

	}else{

		for (i=1;i<=n;++i) sum+=a[i];

		if ((sum+n)&1) return 1;

		else return 0;;

	}

}

void read(int& x){

    x=0;

    int y=1;

    char ch=getchar();

    while (ch<'0'||ch>'9'){

        if (ch=='-') y=-1;

        ch=getchar();

    }

    while (ch>='0'&&ch<='9'){

        x=x*10+ch-'0';

        ch=getchar();

    }

    x=x*y;

}

int main(){

	int i;

	read(n);

	for (i=1;i<=n;++i) read(a[i]);

	if (f()) printf("First\n");

	else printf("Second\n");

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstring>

#include<cmath>

#include<cstdio>

#include<algorithm>

using namespace std;

int a[100010],n;

inline int read(void)

{

	int x=0,f=1;

     char ch=getchar();

     while(ch>'9'||ch<'0'){

       if(ch=='-') f=-1;

       ch=getchar(); }

     while(ch>='0'&&ch<='9'){

       x=x*10+ch-'0';

       ch=getchar();}

     return x*f;

}

int gcd(int a,int b)

{

     return (b==0)?a:gcd(b,a%b);

}

bool pd()

{

	 long long sum=0;

	 int ex=0,tot=0;

	 for(int i=1;i<=n;++i)

	 {

			sum+=a[i]-1;

			if(a[i]&1) tot++;

			if(a[i]==1) ex=1;

	 }

	 if(ex) return sum%2;

	 if((n-tot)%2) return 1;

	 if(tot==1)

	 {

			int g=0;

			for(int i=1;i<=n;++i) if(a[i]&1) a[i]--;

			for(int i=1;i<=n;++i) g=gcd(g,a[i]);

			for(int i=1;i<=n;++i) a[i]/=g;

			return pd()^1;

	 }

	 return 0;

}

int main()

{

	n=read();

	for(int i=1;i<=n;++i) a[i]=read();

	if(pd()) puts("First");

 	else puts("Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

#define MAXN 100000+10

int n,a[MAXN];

int gcd(int a,int b){return b==0?a:gcd(b,a%b);}

bool f(){

    long long sum=0;

    bool flag=0;

    int num=0;

    for(int i=1;i<=n;i++){

        sum+=a[i]-1;

        if(a[i]&1)num++;

        if(a[i]==1)flag=1;

    }

    if(flag)return sum%2;

    if((n-num)%2)return 1;

    if(num==1){

        int g=0;

        for(int i=1;i<=n;i++)

            if(a[i]&1)a[i]--;

        for(int i=1;i<=n;i++)g=gcd(g,a[i]);

        for(int i=1;i<=n;i++)a[i]/=g;

        return f()^1;

    }

    return 0;



}

int main(){

    scanf("%d",&n);

    for(int i=1;i<=n;i++)scanf("%d",&a[i]);

    if(f())printf("First");

    else printf("Second");

}

// Optimized solution to the same problem (faster):
#include<cstring>

#include<cmath>

#include<cstdio>

#include<algorithm>

using namespace std;

int a[100010],n;

inline int read(void)

{

	int x=0,f=1;

     char ch=getchar();

     while(ch>'9'||ch<'0'){

       if(ch=='-') f=-1;

       ch=getchar(); }

     while(ch>='0'&&ch<='9'){

       x=x*10+ch-'0';

       ch=getchar();}

     return x*f;

}

int gcd(int a,int b)

{

     return (b==0)?a:gcd(b,a%b);

}

bool pd()

{

	 long long sum=0;

	 int ex=0,tot=0;

	 for(int i=1;i<=n;++i)

	 {

			sum+=a[i]-1;

			if(a[i]&1) tot++;

			if(a[i]==1) ex=1;

	 }

	 if(ex) return sum%2;

	 if((n-tot)%2) return 1;

	 if(tot==1)

	 {

			int g=0;

			for(int i=1;i<=n;++i) if(a[i]&1) a[i]--;

			for(int i=1;i<=n;++i) g=gcd(g,a[i]);

			for(int i=1;i<=n;++i) a[i]/=g;

			return pd()^1;

	 }

	 return 0;

}

int main()

{

	n=read();

	for(int i=1;i<=n;++i) a[i]=read();

	if(pd()) puts("First");

 	else puts("Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <vector>

#include <algorithm>

#include <numeric>

#define repeat(i,n) for (int i = 0; (i) < int(n); ++(i))

#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)

using ll = long long;

using namespace std;

int gcd(int a, int b) { while (a) { b %= a; swap(a, b); } return b; }

bool solve(int n, vector<int> & a) {

    ll sum = whole(accumulate, a, 0ll);

    bool is_first = (sum - n) % 2;

    int even = whole(count_if, a, [&](int ai) { return ai % 2 == 0; });

    auto odd = whole(find_if,  a, [&](int ai) { return ai % 2 == 1; });

    if (not is_first and even == n-1 and *odd != 1) {

        -- (*odd);

        int d = a[0]; repeat (i,n) d = gcd(d, a[i]);

        repeat (i,n) a[i] /= d;

        return not solve(n, a);

    } else {

        return is_first;

    }

}

int main() {

    int n; cin >> n;

    vector<int> a(n); repeat (i,n) cin >> a[i];

    cout << (solve(n, a) ? "First" : "Second") << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

using namespace std;

const int MAXN=100005;



int n,A[MAXN];



bool solve()

{

	if(n==1)

		return false;

	int cnt[2]={0,0};

	for(int i=1;i<=n;i++)

		cnt[A[i]&1]++;

	if(cnt[0]&1)

		return true;

	if((cnt[0]&1)==0&&cnt[1]>=2)

		return false;

	int pos=-1;

	for(int i=1;i<=n&&pos==-1;i++)

		if(A[i]&1)

			pos=i;

	if(A[pos]==1)

	{

		int sum=0;

		for(int i=1;i<=n;i++)

			sum^=(A[i]-1)&1;

		return sum;

	}

	A[pos]--;

	int g=A[1];

	for(int i=2;i<=n;i++)

		g=__gcd(g,A[i]);

	for(int i=1;i<=n;i++)

		A[i]/=g;

	return solve()^1;

}



int main()

{

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

		scanf("%d",&A[i]);

	if(solve())

		puts("First");

	else

		puts("Second");

	

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



#define PB          push_back

#define PF          push_front

#define MP          make_pair

#define FI          first

#define SE          second

#define SIZE( A )   int( ( A ).size( ) )

#define ALL( A )    ( A ).begin( ), ( A ).end( )

#define ALLR( A )   ( A ).rbegin( ), ( A ).rend( )



using namespace std;



typedef long long           ll;

typedef unsigned long long  ull;

typedef long double         lf;

typedef pair< int, int >    pii;

typedef pair< ll, ll >      pll;

typedef vector< bool >      vb;

typedef vector< lf >        vd;

typedef vector< ll >        vll;

typedef vector< int >       vi;

typedef vector< pii >       vpii;



const int MAXN = int( 1e5 )+10;

const int MOD  = int( 360 );

const int oo   = INT_MAX;



int n, odd, even, cnt;

int arr[ MAXN ];



bool reduce() {

  if( odd != 1 || even%2 ) return false;

  int gcd = 0;

  for( int i = 0; i < n; ++i ) {

    if( arr[i] == 1 ) return false;

    if( arr[i]%2 ) --arr[i];

    gcd = __gcd( gcd, arr[i] );

  }

  odd = even = 0;

  for( int i = 0; i < n; ++i ) {

    arr[i] /= gcd;

    if( arr[i]%2 ) ++odd;

    else ++even;

  }

  return true;

}



int main( ) {



  #ifdef LOCAL

    freopen( "input", "r", stdin );

    //freopen( "output", "w", stdout );

  #else

    //freopen( "input", "r", stdin );

    //freopen( "output", "w", stdout );

    ios_base::sync_with_stdio( 0 );

    cin.tie( 0 );

  #endif



  while( cin >> n ) {

    even = odd = cnt = 0;

    for( int i = 0; i < n; ++i ) {

      cin >> arr[ i ];

      if( arr[i]%2 ) ++odd;

      else ++even;

    }

    while( reduce() ){ ++cnt; }

    even += cnt;

    if( even%2 ) {

      cout << "First\n";

    }

    else {

      cout << "Second\n";

    }

  }

  return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

using namespace std;

const int MAXN=100005;



int n,A[MAXN];



bool solve()

{

	if(n==1)

		return false;

	int cnt[2]={0,0};

	for(int i=1;i<=n;i++)

		cnt[A[i]&1]++;

	if(cnt[0]&1)

		return true;

	if((cnt[0]&1)==0&&cnt[1]>=2)

		return false;

	int pos=-1;

	for(int i=1;i<=n&&pos==-1;i++)

		if(A[i]&1)

			pos=i;

	if(A[pos]==1)

	{

		int sum=0;

		for(int i=1;i<=n;i++)

			sum^=(A[i]-1)&1;

		return sum;

	}

	A[pos]--;

	int g=A[1];

	for(int i=2;i<=n;i++)

		g=__gcd(g,A[i]);

	for(int i=1;i<=n;i++)

		A[i]/=g;

	return solve()^1;

}



int main()

{

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

		scanf("%d",&A[i]);

	if(solve())

		puts("First");

	else

		puts("Second");

	

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <algorithm>



using namespace std;

#define MAXN 100000

#define rint register int

#define gc() getchar()

inline int read(rint ans = 0, rint sgn = ' ', rint ch = gc())

{

	for(; ch < '0' || ch > '9'; sgn = ch, ch = gc());

	for(; ch >='0' && ch <='9';(ans*=10)+=ch-'0', ch = gc());

	return sgn-'-'?ans:-ans;

}

int a[MAXN+5], n;

inline int GCD(int a, int b){return b ? GCD(b,a%b) : a;} 

bool Calc()

{

	int even = 0; bool one = false, sum = 0;

	for(rint i = 1; i <= n; sum ^= (a[i]^1)&1, even += !(a[i]&1), one |= a[i] == 1, i++);

	if(one) return sum; if(even&1) return 1; if(!(even&1) && even < n-1) return 0;

	int g = 0; for(rint i = 1; i <= n; a[i] -= a[i]&1, g = GCD(g,a[i]), i++);

	for(rint i = 1; i <= n; a[i++] /= g); return Calc()^1;

}

int main(){n = read(); for(rint i = 1; i <= n; a[i++] = read()); puts(Calc()?"First":"Second"); return 0;}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

using namespace std;

const int MAXN=100005;



int n,A[MAXN];



bool solve()

{

	if(n==1)

		return false;

	int cnt[2]={0,0};

	for(int i=1;i<=n;i++)

		cnt[A[i]&1]++;

	if(cnt[0]&1)

		return true;

	if((cnt[0]&1)==0&&cnt[1]>=2)

		return false;

	int pos=-1;

	for(int i=1;i<=n&&pos==-1;i++)

		if(A[i]&1)

			pos=i;

	if(A[pos]==1)

	{

		int sum=0;

		for(int i=1;i<=n;i++)

			sum^=(A[i]-1)&1;

		return sum;

	}

	A[pos]--;

	int g=A[1];

	for(int i=2;i<=n;i++)

		g=__gcd(g,A[i]);

	for(int i=1;i<=n;i++)

		A[i]/=g;

	return solve()^1;

}



int main()

{

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

		scanf("%d",&A[i]);

	if(solve())

		puts("First");

	else

		puts("Second");

	

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>

#include <sstream>

#include <iomanip>

#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <cctype>

#include <cstring>

#include <vector>

#include <list>

#include <queue>

#include <deque>

#include <stack>

#include <map>

#include <set>

#include <algorithm>

#include <iterator>

#include <bitset>

#include <ctime>

#include<complex>

using namespace std;



#define FOR(i,a,b) for (int i = (a); i < (b); i++)

#define RFOR(i,b,a) for (int i = (b)-1; i >= (a); i--)

#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)

#define FILL(a,value) memset(a, value, sizeof(a))



#define SZ(a) (int)a.size()

#define ALL(a) a.begin(), a.end()

#define PB push_back

#define MP make_pair



typedef long long LL;

typedef vector<int> VI;

typedef pair<int, int> PII;



const double PI = acos(-1.0);

const int INF = 1000 * 1000 * 1000 + 7;

const LL LINF = INF * (LL)INF;



const int MAX = 1000 * 100 + 47;

int A[MAX];

int n;



int gcd(int a, int b)

{

	return b == 0 ? a : gcd(b, a % b);

}



bool isWin()

{

	int cnt0 = 0, cnt1 = 0;

	FOR(i, 0, n)

	{

		if (A[i] % 2) cnt1++;

		if (A[i] % 2 == 0) cnt0++;

	}



	if (cnt0 % 2) return true;

	if (cnt0 % 2 == 0 && cnt1 >= 2) return false;



	int ind = -1;

	FOR(i, 0, n)

	{

		if (A[i] == 1) continue;

		if (A[i] % 2)

		{

			ind = i;

			break;

		}

	}



	if (ind == -1) return false;

	A[ind]--;

	int g = A[0];

	FOR(i, 0, n)

	{

		g = gcd(A[i], g);

	}



	FOR(i, 0, n)

	{

		A[i] /= g;

	}



	return !isWin();

}



int main()

{

	//freopen("in.txt", "r", stdin);

	//freopen("out.txt", "w", stdout);

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

	cin >> n;

	LL s = 0;

	FOR(i, 0, n)

	{

		cin >> A[i];

	}



	if (isWin())

	{

		cout << "First" << endl;

		return 0;

	}



	cout << "Second" << endl;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

using namespace std;

const int MAXN=100005;



int n,A[MAXN];



bool solve()

{

	if(n==1)

		return false;

	int cnt[2]={0,0};

	for(int i=1;i<=n;i++)

		cnt[A[i]&1]++;

	if(cnt[0]&1)

		return true;

	if((cnt[0]&1)==0&&cnt[1]>=2)

		return false;

	int pos=-1;

	for(int i=1;i<=n&&pos==-1;i++)

		if(A[i]&1)

			pos=i;

	if(A[pos]==1)

	{

		int sum=0;

		for(int i=1;i<=n;i++)

			sum^=(A[i]-1)&1;

		return sum;

	}

	A[pos]--;

	int g=A[1];

	for(int i=2;i<=n;i++)

		g=__gcd(g,A[i]);

	for(int i=1;i<=n;i++)

		A[i]/=g;

	return solve()^1;

}



int main()

{

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

		scanf("%d",&A[i]);

	if(solve())

		puts("First");

	else

		puts("Second");

	

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
//InTheNameOfGod

#include<bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

using namespace std;

using namespace __gnu_pbds;

#define ll long long

#define pii pair<int,int>

#define pll pair<ll,ll>

#define rep(i,j,k) for(int i=j;i<k;++i)

#define rrep(i,j,k) for(int i=j;i>=k;i--)

#define pb push_back

#define lb(i) i&(-i);

template<typename T>

using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const int maxn =1e5+5;

int n,a[maxn],s=0,cnt,p,re=0;

int main()

{

    ios_base::sync_with_stdio(false);cin.tie(0);

    cin>>n;

    rep(i,0,n)

    {

        cin>>a[i];

    }

    while(true)

    {

        cnt=0;

        s=0;

        p=0;

        rep(i,0,n)

        {

            if(a[i]&1)

            {

                cnt++;

                p=a[i];

            }

            else

            {

                s^=1;

            }

        }

        if(s)

        {

            break;

        }

        else if(cnt>1||p==1)

        {

            re^=1;

            break;

        }

        else

        {

            int g=0;

            rep(i,0,n)

            {

                if(a[i]&1)

                {

                    g=__gcd(a[i]-1,g);

                    a[i]--;

                }

                else g=__gcd(a[i],g);

            }

            rep(i,0,n)

            {

                a[i]/=g;

            }

            re^=1;

        }

    }

    if(re)

    {

        cout<<"Second";

    }

    else cout<<"First";

    return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

using namespace std;

const int MAXN=100005;



int n,A[MAXN];



bool solve()

{

	if(n==1)

		return false;

	int cnt[2]={0,0};

	for(int i=1;i<=n;i++)

		cnt[A[i]&1]++;

	if(cnt[0]&1)

		return true;

	if((cnt[0]&1)==0&&cnt[1]>=2)

		return false;

	int pos=-1;

	for(int i=1;i<=n&&pos==-1;i++)

		if(A[i]&1)

			pos=i;

	if(A[pos]==1)

	{

		int sum=0;

		for(int i=1;i<=n;i++)

			sum^=(A[i]-1)&1;

		return sum;

	}

	A[pos]--;

	int g=A[1];

	for(int i=2;i<=n;i++)

		g=__gcd(g,A[i]);

	for(int i=1;i<=n;i++)

		A[i]/=g;

	return solve()^1;

}



int main()

{

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

		scanf("%d",&A[i]);

	if(solve())

		puts("First");

	else

		puts("Second");

	

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cmath>

using namespace std;

#define df 0



const double pi=acos(-1.0);



bool foword(double dx,double dy,int x,int y){

  return dx*x+dy*y>0;

}



long int norm(long int x,long int y){

  return x*x+y*y;

}



int main(){

  if(df) printf("*debug mode*\n");

  int n; cin >> n;

  pair<int,int> engs[n];

  for(auto& eng:engs){

    cin >> eng.first >> eng.second;

  }

  long int max_d=0;

  for(int i=0;i<4000;i++){

    double dx=cos(pi*i/2000),dy=sin(pi*i/2000);

    long int x=0,y=0,temp=0;

    for(auto& eng:engs){

      if(foword(dx,dy,eng.first,eng.second)){

	x+=eng.first;

	y+=eng.second;

	temp=norm(x,y);

	if(max_d<temp){

	  max_d=temp;

	}

      }

    }

  }

  printf("%.15lf",sqrt(max_d));

}



/// confirm df==0 ///

// Optimized solution to the same problem (faster):
#include<iostream>

#include<cmath>

#include<tuple>

#include<algorithm> // sort,reverse

using namespace std;

#define df 0

long int norm(long int x,long int y){

  return x*x+y*y;

}



int main(){

  if(df) printf("*debug mode*\n");

  int n; cin >> n;

  tuple<double,int,int> engs[2*n];

  for(int i=0;i<n;i++){

    int x,y;

    cin >> x >> y;

    get<0>(engs[i])=atan2(x,y);

    get<1>(engs[i])=x;

    get<2>(engs[i])=y;

  }

  sort(engs,engs+n);

  for(int i=0;i<n;i++){

    engs[i+n]=engs[i];

  }

  if(df){

    for(int i=0;i<2*n;i++){

      printf("%lf,%d,%d\n",get<0>(engs[i]),get<1>(engs[i]),get<2>(engs[i]));

    }

  }

  long int max_d=0;

  for(int i=0;i<n;i++){

    long int x=0,y=0;

    for(int j=0;j<n;j++){

      x+=get<1>(engs[i+j]);

      y+=get<2>(engs[i+j]);

      long int temp=norm(x,y);

      if(max_d<temp){

	max_d=temp;

	if(df)printf("%d %d %ld\n",x,y,max_d);

      }

    }

  }

  printf("%.15lf",sqrt(max_d));

}



/// confirm df==0 ///

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef pair<int,int> pii;

const int N = 110;

pii v[N], pos{0, 0};

int n;

double norm(pii p) {return sqrt((ll)p.first*p.first+(ll)p.second*p.second);}

 

signed main() {

	srand(time(NULL));

    ios::sync_with_stdio(false);

    cout << fixed << setprecision(20);

    cin >> n;

  

    for(int i=0;i<n;i++) cin >> v[i].first >> v[i].second;

    const int trials = 1e4;

    double best = 0;

    for(int t=0;t<trials;t++) {

    	random_shuffle(v, v+n);

    	pos = {0, 0};

    	for(int i=0;i<n;i++) {

    		if(norm({pos.first+v[i].first, pos.second+v[i].second}) > norm(pos)) {

    			pos.first += v[i].first;

    			pos.second += v[i].second;

    		}

    	}

    	best = max(best, norm(pos));

    }

    cout << best << endl;

 

    return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;



bool comp( pair<ll,ll> a , pair<ll,ll> b){

    return atan2((double)a.second,a.first) <atan2((double)b.second,b.first);    

}



int main(){

    ll n,a,b;cin>>n;

    vector<pair<ll,ll> >v;

    for(ll i=0;i<n;i++){

        cin>>a>>b;

        v.push_back({a,b});

    }

          

    sort(v.begin(),v.end(),comp); 

    ll sum=0,x,y,temp;

    

    for(ll i=0;i<n;i++){

      x=v[i].first;

      y=v[i].second;

      temp=x*x+y*y;

      sum= max(sum,temp);

      

      ll j=(i+1)%n;

    while(j!=i){

       x+= v[j].first;

       y+= v[j].second;

       temp=x*x+y*y;

       sum=max(sum,temp);

       j=(j+1)%n;

     }

    }

    

    double res=sqrtl(sum);

    cout<<fixed<<setprecision(13)<<res<<endl;

    return 0;

}

// Fastest known solution for this problem: