#include <bits/stdc++.h>
// created [2019/11/15] 17:03:13
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wsign-conversion"

using i32 = int32_t;
using i64 = int64_t;
using u32 = uint32_t;
using u64 = uint64_t;
using uint = unsigned int;
using usize = std::size_t;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
template<typename T> constexpr T popcount(const T u) { return u ? static_cast<T>(__builtin_popcountll(static_cast<u64>(u))) : static_cast<T>(0); }
template<typename T> constexpr T log2p1(const T u) { return u ? static_cast<T>(64 - __builtin_clzll(static_cast<u64>(u))) : static_cast<T>(0); }
template<typename T> constexpr T msbp1(const T u) { return log2p1(u); }
template<typename T> constexpr T lsbp1(const T u) { return __builtin_ffsll(u); }
template<typename T> constexpr T clog(const T u) { return u ? log2p1(u - 1) : static_cast<T>(u); }
template<typename T> constexpr bool ispow2(const T u) { return u and (static_cast<u64>(u) & static_cast<u64>(u - 1)) == 0; }
template<typename T> constexpr T ceil2(const T u) { return static_cast<T>(1) << clog(u); }
template<typename T> constexpr T floor2(const T u) { return u == 0 ? static_cast<T>(0) : static_cast<T>(1) << (log2p1(u) - 1); }
template<typename T> constexpr bool btest(const T mask, const usize ind) { return static_cast<bool>((static_cast<u64>(mask) >> ind) & static_cast<u64>(1)); }
template<typename T> void bset(T& mask, const usize ind) { mask |= (static_cast<T>(1) << ind); }
template<typename T> void breset(T& mask, const usize ind) { mask &= ~(static_cast<T>(1) << ind); }
template<typename T> void bflip(T& mask, const usize ind) { mask ^= (static_cast<T>(1) << ind); }
template<typename T> void bset(T& mask, const usize ind, const bool b) { (b ? bset(mask, ind) : breset(mask, ind)); }
template<typename T> constexpr T bcut(const T mask, const usize ind) { return ind == 0 ? static_cast<T>(0) : static_cast<T>((static_cast<u64>(mask) << (64 - ind)) >> (64 - ind)); }
template<typename T> bool chmin(T& a, const T& b) { return (a > b ? a = b, true : false); }
template<typename T> bool chmax(T& a, const T& b) { return (a < b ? a = b, true : false); }
constexpr unsigned int mod                  = 1000000007;
template<typename T> constexpr T inf_v      = std::numeric_limits<T>::max() / 4;
template<typename Real> constexpr Real pi_v = Real{3.141592653589793238462643383279502884};

template<typename T>
T read()
{
    T v;
    return std::cin >> v, v;
}
template<typename T, typename... Args>
auto read(const usize size, Args... args)
{
    std::vector<decltype(read<T>(args...))> ans(size);
    for (usize i = 0; i < size; i++) { ans[i] = read<T>(args...); }
    return ans;
}
template<typename... Types>
auto reads() { return std::tuple<std::decay_t<Types>...>{read<Types>()...}; }
#    define SHOW(...) static_cast<void>(0)

template<typename T>
std::vector<T> make_v(const usize size, const T v) { return std::vector<T>(size, v); }
template<typename... Args>
auto make_v(const usize size, Args... args) { return std::vector<decltype(make_v(args...))>(size, make_v(args...)); }

template<typename T> T gcd(const T& a, const T& b) { return a < 0 ? gcd(-a, b) : b < 0 ? gcd(a, -b) : (a > b ? gcd(b, a) : a == 0 ? b : gcd(b % a, a)); }
template<typename T> T lcm(const T& a, const T& b) { return a / gcd(a, b) * b; }
template<typename T>
class rational
{
private:
    T num, den;
    static T comp(const rational& r1, const rational& r2) { return (r1 - r2).num; }

public:
    using element_type = T;
    rational() : num{static_cast<element_type>(0)}, den{static_cast<element_type>(1)} {}
    rational(const element_type V) : num{V}, den{static_cast<element_type>(1)} {}
    rational(const element_type N_, const element_type D_) : num{N_}, den{D_}
    {
        assert(den != element_type(0));
        if (den < 0) { num = -num, den = -den; }
        const element_type g = gcd(std::abs(num), den);
        num /= g, den /= g;
    }
    rational& operator=(const element_type v) { return den = static_cast<element_type>(1), num = v, *this; }
    rational& operator=(const rational& r) { return den = r.den, num = r.num, *this; }
    friend rational operator-(const rational& r) { return rational{-r.num, r.den}; }
    friend rational operator+(const rational& r1, const rational& r2)
    {
        const element_type D = lcm(r1.den, r2.den), N = r1.num * (D / r1.den) + r2.num * (D / r2.den);
        return rational{N, D};
    }
    friend rational operator+(const element_type v1, const rational& r2) { return rational{v1} + r2; }
    friend rational operator+(const rational& r1, const element_type v2) { return r1 + rational{v2}; }
    friend rational operator-(const rational& r1, const rational& r2) { return r1 + (-r2); }
    friend rational operator-(const element_type v1, const rational& r2) { return rational{v1} - r2; }
    friend rational operator-(const rational r1, const element_type v2) { return r1 - rational{v2}; }
    friend rational operator*(const rational& r1, const rational& r2)
    {
        const element_type g1 = gcd(r1.num, r2.den), g2 = gcd(r1.den, r2.num), D = (r1.den / g2) * (r2.den / g1), N = (r1.num / g1) * (r2.num / g2);
        return rational{N, D};
    }
    friend rational operator*(const element_type v1, const rational& r2) { return rational{v1} * r2; }
    friend rational operator*(const rational& r1, const element_type v2) { return r1 * rational{v2}; }
    friend rational operator/(const rational& r1, const rational& r2) { return r1 * rational{r2.den, r2.num}; }
    friend rational operator/(const element_type v1, const rational& r2) { return rational{v1} / r2; }
    friend rational operator/(const rational r1, const element_type v2) { return r1 / rational{v2}; }
    friend rational& operator+=(rational& r1, const rational& r2) { return r1 = r1 + r2; }
    friend rational& operator+=(rational& r1, const element_type v2) { return r1 = r1 + v2; }
    friend rational& operator-=(rational& r1, const rational& r2) { return r1 = r1 - r2; }
    friend rational& operator-=(rational& r1, const element_type v2) { return r1 = r1 - v2; }
    friend rational& operator*=(rational& r1, const rational& r2) { return r1 = r1 * r2; }
    friend rational& operator*=(rational& r1, const element_type v2) { return r1 = r1 * v2; }
    friend rational& operator/=(rational& r1, const rational& r2) { return r1 = r1 / r2; }
    friend rational& operator/=(rational& r1, const element_type v2) { return r1 = r1 / v2; }
    friend bool operator==(const rational& r1, const rational& r2) { return r1.den == r2.den and r1.num == r2.num; }
    friend bool operator==(const rational& r1, const element_type v2) { return r1.den == element_type(1) and r1.num == v2; }
    friend bool operator==(const element_type v1, const rational& r2) { return r2.den == element_type(1) and r2.num == v1; }
    friend bool operator!=(const rational& r1, const rational& r2) { return not(r1 == r2); }
    friend bool operator!=(const rational& r1, const element_type v2) { return not(r1 == v2); }
    friend bool operator!=(const element_type v1, const rational& r2) { return not(v1 == r2); }
    friend bool operator<(const rational& r1, const rational& r2) { return comp(r1, r2) < element_type(0); }
    friend bool operator<(const rational& r1, const element_type v2) { return r1.num < r1.den * v2; }
    friend bool operator<(const element_type v1, const rational& r2) { return v1 * r2.den < r2.num; }
    friend bool operator>(const rational& r1, const rational& r2) { return comp(r2, r1) < element_type(0); }
    friend bool operator>(const rational& r1, const element_type v2) { return r1.num > r1.den * v2; }
    friend bool operator>(const element_type v1, const rational& r2) { return v1 * r2.den > r2.num; }
    friend bool operator<=(const rational& r1, const rational& r2) { return not(r1 > r2); }
    friend bool operator<=(const rational& r1, const element_type v2) { return not(r1 > v2); }
    friend bool operator<=(const element_type v1, const rational& r2) { return not(v1 > r2); }
    friend bool operator>=(const rational& r1, const rational& r2) { return not(r1 < r2); }
    friend bool operator>=(const rational& r1, const element_type v2) { return not(r1 < v2); }
    friend bool operator>=(const element_type v1, const rational& r2) { return not(v1 < r2); }
    friend std::ostream& operator<<(std::ostream& os, const rational& r) { return os << r.num << "/" << r.den; }
    T n() const { return num; }
    T d() const { return den; }
};
int main()
{
    const auto n = read<usize>();
    std::vector<ll> a(n), b(n);
    for (usize i = 0; i < n; i++) { std::cin >> a[i] >> b[i]; }
    std::vector<usize> pis, fis;  // 引き離し用,追いつき用
    for (usize i = 0; i < n; i++) { (a[i] < b[i] ? fis : pis).push_back(i); }
    std::sort(pis.begin(), pis.end(), [&](const usize i, const usize j) { return a[i] < a[j]; });
    SHOW(pis, fis);
    ll fsum = 0;
    for (const usize i : fis) { fsum += b[i] - a[i]; }
    SHOW(fsum);
    std::vector<ll> sps(pis.size());
    for (usize i = 0; i < pis.size(); i++) { sps[i] = a[pis[i]] + (i == 0 ? 0LL : sps[i - 1]); }
    SHOW(sps);
    rational<ll> max = 0;
    for (usize j = 0; j < pis.size(); j++) {
        const usize i        = pis[j];
        const ll oitsuki_max = fsum + b[i] - a[i];
        SHOW(oitsuki_max);
        int inf = -1, sup = pis.size();
        while (sup - inf > 1) {
            const int mid                                                   = (inf + sup) / 2;
            (sps[mid] <= oitsuki_max + (j <= mid ? a[i] : 0LL) ? inf : sup) = mid;
        }
        const int pnum = sup;
        SHOW(i, pnum);
        const ll mid = (pnum == 0 ? 0LL : sps[pnum - 1] - (pnum > j ? a[i] : 0LL)) + a[i] - fsum;
        SHOW(mid);
        if (mid < 0) { continue; }
        chmax(max, (pnum >= j ? pnum - 1 : pnum) + 1 - rational(mid, b[i]));
    }
    for (const usize i : fis) {
        const ll oitsuki_max = fsum;
        SHOW(oitsuki_max);
        int inf = -1, sup = pis.size();
        while (sup - inf > 1) {
            const int mid                         = (inf + sup) / 2;
            (sps[mid] <= oitsuki_max ? inf : sup) = mid;
        }
        const int pnum = sup;
        SHOW(i, pnum);
        const ll mid = (pnum == 0 ? 0LL : sps[pnum - 1]) - (fsum - b[i]);
        SHOW(mid);
        if (mid < 0) { continue; }
        chmax(max, pnum + 1 - rational(mid, b[i]));
    }
    const rational<ll> ans = max / rational<ll>{(ll)n};
    std::cout << ans.n() << " " << ans.d() << std::endl;
    return 0;
}
