#include #include #include #include #include using namespace std; map s; map::iterator it; double eps=1e-10; int n,m; const double pi=acos(-1.0); int fa[1001],x[1001],y[1001],cx[1001],cy[1001],r[1001]; struct Eve { double ang; int id,L,f; bool operator<(const Eve &b)const { if(fabs(ang-b.ang)>eps)return angb.f; } }p[8001]; int find(int x) { if(x==fa[x])return x; return fa[x]=find(fa[x]); } void U(int i,int j) { fa[find(i)]=find(j); } int main() { while(~scanf("%d%d",&n,&m)) { for(int i=0;ifirst>p[j].L)U(i,p[j].id); } } else if(p[j].f==1) { s[p[j].L]++; ++tot; } else { s[p[j].L]--; if(s[p[j].L]==0)s.erase(p[j].L); --tot; } } } int cnt=0; for(int i=0;i