// オリジナル: https://yukicoder.me/submissions/990891 #include using namespace std; #include using namespace atcoder; using mint = modint998244353; // 1000000007; using ll = long long; using pp = pair; #define sr string #define vc vector #define fi first #define se second #define rep(i, n) for (int i = 0; i < (int)n; i++) #define pb push_back #define all(v) v.begin(), v.end() #define pque priority_queue #define bpc(a) __builtin_popcount(a) int main() { int n; cin >> n; vc v(n); for (auto& [a, b] : v) cin >> a >> b; int m = 2e5 + 5; vc d(m, vc(0)); for (int i = 1; i < m; i++) for (int j = i; j < m; j += i) d[j].pb(i); vc dx(m, vc(0)); for (auto p : v) for (auto au : d[p.fi]) dx[au].pb(p); int ans = 0; for (int i = 1; i < m; i++) if (dx[i].size()) { auto& vx = dx[i]; // sort にわたす比較関数は等しい場合は false を返すように実装します。 // sort(all(vx), // [&](pp a, pp b) { return (ll)a.fi * a.se >= (ll)b.fi * b.se; }); sort(all(vx), [&](pp a, pp b) { return (ll)a.fi * a.se > (ll)b.fi * b.se; }); int mn = 1e9 + 5; for (auto [a, b] : vx) { ans = max(ans, b / mn); mn = min(mn, a / i); } } cout << ans; }