ll@n,@q,@c[n]; rep(q){ ll@t; if(t==1){ ll@x,@y; c[x-1]=y; }else{ ll@(l,r,a,b); wt(sum[i,l-1,r](max(a,min(b,c[i])))); } }