#include <bits/stdc++.h>
using namespace std;
//#define cerr if (false) cerr
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define dbv(v) cerr << #v << "="; for (auto _x : v) cerr << _x << ", "; cerr << endl
#define dba(a, n) cerr << #a << "="; for (int _i = 0; _i < (n); ++_i) cerr << a[_i] << ", "; cerr << endl
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& x) {
	return os << "(" << x.first << "," << x.second << ")";
}
typedef long long ll;
typedef long double ld;
// Fraction a/b, where b > 0. Ensure |a|, |b| < 2^31.
struct Fraction {
	ll a, b;
	Fraction() : Fraction(0) {}
	Fraction(ll x) : a(x), b(1) {}
	Fraction(ll _a, ll _b) : a(_a), b(_b) {
		assert(b != 0);
		if (b < 0) {
			b = -b;
			a = -a;
		}
		ll g = __gcd(abs(a), b);
		a /= g;
		b /= g;
	}
	friend bool operator==(const Fraction& a, const Fraction& b) { return a.a == b.a && a.b == b.b; }
	friend bool operator!=(const Fraction& a, const Fraction& b) { return !(a == b); }
	friend bool operator<(const Fraction& a, const Fraction& b) { return a.a * b.b < b.a * a.b; }
	friend bool operator>(const Fraction& a, const Fraction& b) { return b < a; }
	friend bool operator<=(const Fraction& a, const Fraction& b) { return a < b || a == b; }
	friend bool operator>=(const Fraction& a, const Fraction& b) { return b < a || a == b; }
	friend Fraction operator+(Fraction a, const Fraction& b) { return Fraction(a.a * b.b + b.a * a.b, a.b * b.b); }
	friend Fraction operator-(Fraction a, const Fraction& b) { return Fraction(a.a * b.b - b.a * a.b, a.b * b.b); }
	friend Fraction operator*(Fraction a, const Fraction& b) { return Fraction(a.a * b.a, a.b * b.b); }
	friend Fraction operator/(Fraction a, const Fraction& b) { return Fraction(a.a * b.b, a.b * b.a); }
	Fraction& operator+=(const Fraction& f) { return *this = *this + f; }
	Fraction& operator-=(const Fraction& f) { return *this = *this - f; }
	Fraction& operator*=(const Fraction& f) { return *this = *this * f; }
	Fraction& operator/=(const Fraction& f) { return *this = *this / f; }
	friend ostream& operator<<(ostream& os, const Fraction& x) { return os << x.a << "/" << x.b; }
};
int main() {
	int n;
	scanf("%d", &n);
	vector<int> bs, as;
	ll suma = 0;
	for (int i = 0; i < n; ++i) {
		int a, b;
		scanf("%d%d", &a, &b);
		if (a < b) {
			suma += a;
			bs.push_back(b);
		} else as.push_back(a);
	}
	if (bs.empty()) {
		printf("0 1\n");
		return 0;
	}
	sort(as.begin(), as.end());
	sort(bs.begin(), bs.end());
	ll sumb = 0;
	int i = (int)bs.size() - 1;
	int j = 0;
	Fraction ret(0);
	for (;;) {
		for (; i >= 0; --i) {
			if (sumb + bs[i] >= suma) {
				Fraction f(suma - sumb, bs[i]);
				Fraction ans = (i + 1 - f + j) / n;
				ret = max(ret, ans);
				break;
			}
			sumb += bs[i];
		}
		if (j == as.size()) break;
		suma += as[j++];
	}
	printf("%lld %lld\n", ret.a, ret.b);
}
