#include <bits/stdc++.h>
#define yes { cout << "YES" << endl; exit(0); }
#define no { cout << "NO" << endl; exit(0); }
#define impossible { cout << "Impossible" << endl; exit(0); }

using namespace std;

typedef long long ll;
typedef pair<int,int> Pair;


const int Nmax = 1e5 + 5;

int A[Nmax], B[Nmax];
ll sum = 0;
int mns[Nmax];
int n;
int forb;
int ord[Nmax];

ll need(int s)
{
    int i;
    ll now;

    now = sum;
    int nr = 0;

    for(i=1; nr < n-s+1; ++i)
        if(forb != ord[i])
        {
            now -= mns[ord[i]];
            ++nr;
        }
    return now;
}

bool cmp(int x, int y)
{
    return mns[x] > mns[y];
}

int main()
{
   // freopen("inputD", "r", stdin);
    // freopen("output", "w", stdout);
    cin.sync_with_stdio(false); cin.tie(0);

    cin >> n;
    int i;
    for(i=1; i<=n; ++i) cin >> A[i] >> B[i];

    for(i=1; i<=n; ++i) sum += A[i];
    for(i=1; i<=n; ++i) mns[i] = max(A[i], B[i]), ord[i] = i;

    sort(ord+1, ord+n+1, cmp);

    int st, dr, mid;

    st = 1; dr = n;
    while(st <= dr)
    {
        mid = (st + dr) / 2;
        if(need(mid) <= 0) st = mid + 1;
            else dr = mid - 1;
    }

    int start = dr;
    ll P = 0, Q = 1;

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

        ll p = -(need(start+1) - B[i]);
        ll q = B[i];

        double proc = -1.0 * (need(start+1) - B[i]) / B[i];
       // cerr << (dr-1 + proc) / n << '\n';

        if(p * Q > P * q) P = p, Q = q;
    }


    P += (ll) Q * (start - 1);
    Q *= n;

    ll g = __gcd(P, Q);
    P /= g;
    Q /= g;

    cout << P << ' ' << Q << '\n';

    return 0;
}
