#include using namespace std; #define all(v) (v).begin(),(v).end() #define pb(a) push_back(a) #define rep(i, n) for(int i=0;i> n; ll N = 200001; vector B(N, 0); ll ans = 0; rep(i, n) { ll a, b; cin >> a >> b; ans = max(ans, min(b, B[a])); B[a] = max(B[a], b); } vector> v; for(ll i = 1; i < N; i ++) { if(B[i]) v.push_back({i * B[i], i}); } ll M = 400001; sort(all(v)); reverse(all(v)); vector exist(M, 0); for(auto [Max, x] : v) { for(ll i = x; i < M; i += x) { if(exist[i]) { ans = max(ans, Max / i); break; } } for(ll i = x; i < M; i += x) { exist[i] = 1; } } cout << ans << endl; return 0; }