ll@n,@k,@x,@y,@a[n]; rep[a](x,n)x=(x-1)/+k; sortA(n,a); ll b=max(0,n-y/x); ll c=b?a[b-1]:0; //wt(y*c+x*sum[i,b,n](a[i]-c)); wt(y*c+x*sum[i,b,n](a[i])-x*c*(n-b));