ll@n,@(l,r)[n]; sortA(n,l); ll a=max[i,0,n](l[i]-i); sortA(n,r); ll b=min[i,0,n](r[i]-i); wt(b-a+1>0?b-a+1:0);