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