ll@n,@k,@x,b=0,z=-ll_inf; Heaph; h.malloc(k+1); rep(i,n){ ll@a; b+=a-x; h.push(a); if(i>=k){ b-=h.pop(); } z>?=b; } wt(z);