#pragma GCC optimize("Ofast") #pragma GCC target("avx2") char*mmap(); #define RD(v) int v=0;{int c;while(c=*rp++-48,c>=0)v=v*10+c;} char wbuf[32]; #define WT(v) *--wp=32;while(*--wp=v%10+48,v/=10); #define N 100000 int abuf[N*2+1]; #define a (abuf+N) main(){ char*rp=mmap(0l,1600l<<10,1,2,0,0ll); while(*rp++!=10); do{ int neg=0; if(*rp=='-'){ ++rp; neg=1; } RD(x); if(neg) x=-x; ++a[x]; }while(*rp); char*wp=wbuf+sizeof wbuf; // moist { int z=a[0]>>1; for(int i=N+1;--i;){ z+=a[-i]y) t=y; z+=t; y-=t; } z+=y>>1; WT(z); } // dry { int z=0,y=0; for(int i=N+1;--i;){ y+=a[-i]; int t=a[i-1]; if(t>y) t=y; z+=t; y-=t; } z+=y>>1; WT(z); } write(1,wp,wbuf+(sizeof wbuf)-wp); _exit(0); }