#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<ctime>
#include<map>
#include<bitset>
#include<set>
#define LL long long
#define mp(x,y) make_pair(x,y)
#define pll pair<long long,long long>
#define pii pair<int,int>
using namespace std;
inline LL read()
{
	LL f=1,x=0;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int stack[20];
template<typename T>inline void write(T x)
{
	if(x<0){putchar('-');x=-x;}
    if(!x){putchar('0');return;}
    int top=0;
    while(x)stack[++top]=x%10,x/=10;
    while(top)putchar(stack[top--]+'0');
}
template<typename T>inline void pr1(T x){write(x);putchar(' ');}
template<typename T>inline void pr2(T x){write(x);putchar('\n');}
const int MAXN=100005;
struct line{int A,B,val;}w[MAXN];
bool cmp(line n1,line n2){return n1.val>n2.val;}
int n;LL pre[MAXN],S,mn1[MAXN],mn2[MAXN];
LL getval(int a,int b){return a<b?pre[a]:pre[a]-w[b].val;}
LL gcd(LL a,LL b){return a==0?b:gcd(b%a,a);}
int main()
{
//	freopen("01-10.txt","r",stdin);
	n=read();
	for(int i=1;i<=n;i++)w[i].A=read(),w[i].B=read(),w[i].val=max(w[i].A,w[i].B),S+=w[i].A;
	sort(w+1,w+1+n,cmp);
	for(int i=1;i<=n;i++)pre[i]=pre[i-1]+w[i].val;
	LL ansx=0,ansy=1;
	for(int i=1;i<=n;i++)
	{
		int l=1,r=n,ps=-1;
		while(l<=r)
		{
			int mid=(l+r)/2;
			if(getval(mid,i)>=S)r=mid-1;
			else if(getval(mid,i)+w[i].B<S)l=mid+1;
			else {ps=mid;r=mid-1;}
		}if(ps==-1)continue;
		int id=i;LL S2=getval(ps,i)+w[i].B-S;
		LL nowx=n-ps-(ps<i),nowy=1;
		LL fx=S2,fy=w[id].B;LL d=gcd(fx,fy);fx/=d;fy/=d;
		nowy=fy;nowx=fx+fy*nowx;d=gcd(nowx,nowy);nowx/=d;nowy/=d;
		if(1.0*ansx*nowy<=1.0*ansy*nowx)ansx=nowx,ansy=nowy;
	}
	ansy=1LL*ansy*n;LL d=gcd(ansx,ansy);ansx/=d;ansy/=d;
	pr1(ansx);pr2(ansy);
//	if(1.0*2730399553711*372637208115>1.0*2981097664920*186319854506)puts("YES");
	return 0;
}
//2730399553711 2981097664920
//186319854506  372637208115