#include #include #define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) using namespace atcoder; using namespace std; typedef long long ll; struct fraction { ll p, q; fraction(ll P = 0, ll Q = 1) : p(P), q(Q) { ll g = gcd(p, q); p /= g; q /= g; } bool operator<(const fraction &other) const { return p * other.q < other.p * q; } bool operator<=(const fraction &other) const { return p * other.q <= other.p * q; } bool operator>(const fraction &other) const { return p * other.q > other.p * q; } bool operator>=(const fraction &other) const { return p * other.q >= other.p * q; } bool operator==(const fraction &other) const { return p * other.q == other.p * q; } fraction operator+(const fraction &other) const { return fraction(p * other.q + other.p * q, q * other.q); } fraction operator-(const fraction &other) const { return fraction(p * other.q - other.p * q, q * other.q); } fraction operator*(const fraction &other) const { return fraction(p * other.p, q * other.q); } fraction operator/(const fraction &other) const { return fraction(p * other.q, q * other.p); } fraction operator+=(const fraction &other) { return *this = *this + other; } fraction operator-=(const fraction &other) { return *this = *this - other; } fraction operator*=(const fraction &other) { return *this = *this * other; } fraction operator/=(const fraction &other) { return *this = *this / other; } }; int main() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(0); int n; cin >> n; vector a(n); rep(i, 0, n) cin >> a[i]; sort(a.begin(), a.end()); fraction ans = fraction(1, 1); ll tar = (ll)n * (n - 1) / 2; auto f = [&](fraction p) { ll cnt = 0; rep(i, 0, n) { int ac = -1, wa = n; while (wa - ac > 1) { int m = ac + (wa - ac) / 2; if (fraction(a[m], a[i]) > p) wa = m; else ac = m; } cnt += ac + 1; } if (cnt >= tar) ans = min(ans, p); return (cnt >= tar); }; vector fs(n - 1); rep(i, 0, n - 1) { fs[i] = fraction(a[i], a[i + 1]); } sort(fs.begin(), fs.end()); int wa = -1, ac = n; while (ac - wa > 1) { int m = wa + (ac - wa) / 2; if (f(fs[m])) ac = m; else wa = m; } cout << ans.p << " " << ans.q << endl; }