/*
 * @Author: RBQRBQ
 * @Date: 2020-04-06 20:28:58
 * @LastEditors: RBQRBQ
 * @LastEditTime: 2020-04-08 19:09:22
 */
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
typedef vector<int> VI;
typedef pair<int,int> pii;

namespace IO{
    template<typename T>inline void read(T &x){
        x=0;ll f=1;char ch=getchar();
        while(!isdigit(ch)){if(ch=='-')f=-f;ch=getchar();}
        while(isdigit(ch)){x=x*10+ch-48;ch=getchar();}
        x=x*f;
    }
}

using namespace IO;

typedef pair<ll,ll> frac;

ll N,S=0;
vector<frac> T;
bool mp(frac A,frac B)
{
    return (A.first*B.second<A.second*B.first);
}
ll gcd(ll x,ll y) { return (!y)?x:gcd(y,x%y); }
signed main()
{

    read(N);
    for(int i=1;i<=N;i++)
    {   
        ll x,y;
        read(x),read(y);
        S+=x;
        T.push_back(make_pair(std::max(x,y),y));
    }
    sort(T.begin(),T.end(),greater<frac>());
    ll pos=0;
    ll point=0;
    int ca=0;
    for(auto it=T.begin();it!=T.end();it++)
    {
        if((pos+it->first) >S) break;
        pos+=it->first;
        point=it-T.begin();
        ca++;
    }
    if(ca==N){cout<<"0 1"<<endl;return 0;}
    frac ans(0,1);
    for(int i=0;i<T.size();++i)
    {
        if(i+1>ca)
        {
            if(pos+T[i].second>=S) 
            {
                frac res(pos+T[i].second-S,T[i].second);
                ans=(mp(ans,res))?res:ans;
            }
        }
        else
        {
            if(pos-T[i].first+T[point+1].first+T[i].second>=S)
            {
                frac res(pos-T[i].first+T[point+1].first+T[i].second-S,T[i].second);
                ans=(mp(ans,res))?res:ans;
            }
        } 
    }
    ans.first+=ans.second*(N-ca-1);ans.second*=N;
    ll _f=gcd(ans.first,ans.second);
    cout<<ans.first/_f<<" "<<ans.second/_f<<endl;
    return 0;
}