ll a[2d5],b[2d5]; { ll @n,@x,@y; rd(a(n)); ll s=sum(a(n)); { ll l=-ll_inf,p=0,m=0; rep(i,n-2){ p+=x-a[i]; b[i]=l>?=p-m+s; m?=p-m; m