#pragma GCC optimize("Ofast") #pragma GCC target("avx2") char*mmap(); #define RD(v) int v=0;while(c=*r++-48,c>=0)v=v*10+c; #define RDN(v) f=*r=='-'?++r,1:0;RD(v);v=f?-v:v; #define RDL(v) long v=0;while(c=*r++-48,c>=0)v=v*10+c; int ufb[1000]; int uf(int i){return ufb[i]>=0?ufb[i]=uf(ufb[i]):i;} int ax[1000],ay[1000]; main(){ char*r=mmap(0,16*1024,1,2,0,0l); int c,f; RD(n); for(int i=0;iufb[gj]){ ufb[gj]+=ufb[gi]; ufb[gi]=gj; gi=gj; }else{ ufb[gi]+=ufb[gj]; ufb[gj]=gi; } } } } } int m=0; for(int i=0;i