#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 1000000000000000001 int op(int a,int b){ return max(a,b); } int e(){ return -Inf32; } int main(){ //ios::sync_with_stdio(false); //std::cin.tie(nullptr); int n; cin>>n; vector> bs(200001); rep(i,n){ int a,b; scanf("%d %d",&a,&b); bs[a].push_back(b); } rep(i,bs.size()){ if(bs[i].size()>2){ sort(bs[i].rbegin(),bs[i].rend()); while(bs[i].size()>2)bs[i].pop_back(); reverse(bs[i].begin(),bs[i].end()); } } long long ok = 0,ng = Inf32; segtree seg(200001); while(ng-ok>1){ long long mid = (ok+ng)/2; bool f = false; for(long long i=1;i<=200000;i++){ for(long long j=i;j<=200000;j+=i){ rep(k,bs[j].size()){ long long a = j,b = bs[j][k]; long long R = (b * i) / mid; R++; R = min(R,200001LL); if(i*seg.prod(0,R) >= mid*a){ f = true; break; } seg.set(a,max((long long)seg.get(a),b)); } if(f)break; } for(long long j=i;j<=200000;j+=i){ seg.set(j,-Inf32); } if(f)break; } if(f)ok = mid; else ng = mid; } cout<