#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> inds(n);
    std::iota(inds.begin(), inds.end(), 0UL);
    std::sort(inds.begin(), inds.end(), [&](usize i, usize j) { return std::max(a[i], b[i]) > std::max(a[j], b[j]); });
    const ll A = std::accumulate(a.begin(), a.end(), 0LL);
    std::vector<ll> M(n, 0LL);
    for (usize i = 0; i < n; i++) { M[i] = std::max(a[i], b[i]); }
    std::sort(M.begin(), M.end(), std::greater<ll>{});
    auto S = M;
    for (usize i = 1; i < n; i++) { S[i] += S[i - 1]; }
    SHOW(M, S);
    using Q = rational<ll>;
    Q max   = 0;
    for (usize i = 0; i < n; i++) {
        const ll min = A - b[inds[i]];
        int inf = -1, sup = (int)n;
        while (sup - inf > 1) {
            const int mid           = (inf + sup) / 2;
            const ll sum            = S[mid] - (mid >= i ? std::max(a[inds[i]], b[inds[i]]) : 0LL);
            (sum < min ? inf : sup) = mid;
        }
        if (sup == n) { continue; }
        const int use = (sup >= i ? sup : sup + 1);
        SHOW(sup, inds[i], use);
        const ll res = A - S[sup] + (sup >= i ? std::max(a[inds[i]], b[inds[i]]) : 0LL);
        if (res < 0) { continue; }
        SHOW(res);
        Q ans = n - use - Q{res} / Q{b[inds[i]]};
        chmax(max, ans);
    }
    const Q ans = max / Q{(ll)n};
    std::cout << ans.n() << " " << ans.d() << std::endl;
    return 0;
}


Measured memory_bytes: 4224