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); ll z=0; rep(i,l-1,r){ z+=max(a,min(b,c[i])); } wt(z); } }