program bzoj1828; ; check=; type node=record l,r,s,a:longint; end; ..maxn*] of node; a,b,c:..maxn] of longint; n,m,i,ans,mini:longint; procedure swap(var x,y:longint); begin x:=x xor y; y:=x xor y; x:=x xor y; end; procedure qsort(l,r:longint); var i…