ll@n,@k,@a[n],z=0,s=0; Heapq; q.walloc(k); rrep(i,n){ if(i&1)z>?=s+a[i]; s+=q.push(a[i]); if(i<=n-k)s-=q.pop(); } wt(z);