#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(); } } 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++){ vector> seg; for(long long j=i;j<=200000;j+=i){ rep(k,bs[j].size()){ long long a = j,b = bs[j][k]; if(i*1000000000 < mid*a)break; long long R = (b * i) / mid; R++; R = min(R,200001LL); int d = distance(seg.begin(),lower_bound(seg.begin(),seg.end(),make_pair(R,-1LL))); if(d>0){ if(i * seg[d-1].second >= mid*a){ f = true; goto L; } } /* if(R==200001){ if(i*seg.all_prod() >= mid*a){ f = true; goto L; } } else{ if(i*seg.prod(0,R) >= mid*a){ f = true; goto L; } } */ //while(seg.size()>0 && seg.back().second >= b)seg.pop_back(); if(seg.size()==0 || seg.back().second < b)seg.emplace_back(a,b); //seg.set(a,max((long long)seg.get(a),b)); } } L:; /* for(long long j=i;j<=200000;j+=i){ seg.set(j,-Inf32); } */ if(f)break; } if(f)ok = mid; else ng = mid; } cout<