ll@n,@m,b[n]{},a=0,c=0; rep(i,m){ ll@p--,@q; if(p-q<0){ a+=-(p-q); b[0]+=1; }else{ b[p-q]+=1; } b[p]+=-2; if(p+q