#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); int n; cin >> n; const int M = 2e5; vector b(M + 1); long long ans = 0; for (int i = 0; i < n; i++) { int a, bb; cin >> a >> bb; ans = max(ans, (long long)min(bb, b[a])); b[a] = max(b[a], bb); } using pll = pair; for (int g = 1; g <= M; g++) { vector ab; for (int i = g; i <= M; i += g) { if (b[i] > 0) { ab.push_back({i, b[i]}); } } if (ab.size() < 2) { continue; } sort(ab.begin(), ab.end(), [&](pll a, pll b) { return a.first * a.second < b.first * b.second; }); long long b_ma = 0; for (auto [a, b] : ab) { ans = max(ans, b_ma / (a / g)); b_ma = max(b_ma, b); } } cout << ans << endl; }