#include //ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair pii; typedef pair ppii; typedef pair pipi; typedef pair pll; typedef pair ppll; typedef pair plpl; typedef tuple tl; ll mod=1000000007; ll mod2=998244353; ll mod3=1000003; ll mod4=998244853; ll inf=1000000000; double pi=2*acos(0); #define rep(i,m,n) for(ll i=m;i=m;i--) int dh[4]={1,-1,0,0}; int dw[4]={0,0,1,-1}; int ddh[8]={-1,-1,-1,0,0,1,1,1}; int ddw[8]={-1,0,1,-1,1,-1,0,1}; ll lmax(ll a,ll b){ if(a0){ if(k&1)ret*=now; now*=now; k/=2; } return ret; } ll beki(ll n,ll k,ll md){ ll ret=1; ll now=n; while(k>0){ if(k%2==1){ ret*=now; ret%=md; } now*=now; now%=md; k/=2; } return ret; } ll gyaku(ll n,ll md){ return beki(n,md-2,md); } bool cmp(pll a,pll b){ if(a.first*b.first<0)return a.first>b.first; if(a.first==0){ if(b.first==0){ if(a.second==-1)return true; else return false; } if(a.second==1){ if(b.first>0)return false; else return true; } if(a.second==-1){ return true; } } if(b.first==0){ if(b.second==-1)return false; else{ if(a.first>0)return true; else return false; } } return a.second*b.first>n; //cout< v[2]; int r[2]={0,0}; map mp; rep(i,0,n){ ll a,b;cin>>a>>b; ll c=gcd(abs(a),abs(b)); if(a==0){ if(b==0)continue; if(b>0)r[0]++; else r[1]++; continue; } if(mp[{a/c,b/c}]){mp[{a/c,b/c}]++;continue;} mp[{a/c,b/c}]=1; if(a>0)v[0].push_back({a/c,b/c}); else v[1].push_back({a/c,b/c}); } //cout< w; if(r[1])w.push_back({0,-1}); rep(i,0,v[0].size())w.push_back(v[0][i]); if(r[0])w.push_back({0,1}); rep(i,0,v[1].size())w.push_back(v[1][i]); mp[{0,1}]=r[0]; mp[{0,-1}]=r[1]; ll mae[w.size()]; ll saki[w.size()]; rep(i,0,w.size()){ ll u=i,d=-1; ll f=-w[i].first,g=-w[i].second; pll pp={f,g}; if(f<0){ mae[i]=-1; continue; } while(u-d>1){ ll mid=(u+d)/2; if(pp==w[mid]){ d=mid; continue; } if(cmp(w[mid],pp))d=mid; else u=mid; } mae[i]=d; } rep(i,0,w.size()){ ll u=w.size(),d=i; ll f=-w[i].first,g=-w[i].second; pll pp={f,g}; if(f>0){ saki[i]=w.size()-1; continue; } if(f==0&&g==-1){ saki[i]=w.size()-1; continue; } while(u-d>1){ ll mid=(u+d)/2; if(pp==w[mid]){ d=mid; continue; } if(cmp(w[mid],pp))d=mid; else u=mid; } saki[i]=d; } rep(i,0,w.size()){ //cout<