#include #define int long long using namespace std; inline int read() { register int x=0,f=0;register char c=getchar(); while(c<'0'||c>'9')f=(c=='-'),c=getchar(); while(c>='0'&&c<='9')x=(x<<3)+(x<<1)+(c&15),c=getchar(); return f?-x:x; } const int MAXN=1e6; int n,a,b,w,d[MAXN],dp[MAXN]; double Y(int i){ double s=dp[i]+i*i*0.5*b+b*i*0.5+i*a; return s*1.000; } int X(int i){ return 1.0*i; } //long double K(int j1,int j2){ // return (long double)1.0*(Y(j1)-Y(j2))/(X(j1)-X(j2)); //} //inline long double Y(int i){ // double s=dp[i]+b*i*i*0.5+b*i*0.5+i*a; // return s*1.000; //} //inline long double X(int i){return i*1.00;} inline long double K(int i,int j){return (Y(i)-Y(j))*1.00/(X(i)-X(j));} int q[MAXN],head,tail; signed main() { // freopen("chips.in","r",stdin); // freopen("chips.out","w",stdout); memset(dp,0x3f,sizeof dp); n=read();a=read();b=read();w=read(); for(int i=1;i<=n;i++)d[i]=read(); dp[0]=w; head=1;tail=1;q[1]=0; for(int i=1;i<=n;i++){ while(head=0;i--){ ans=min(ans,dp[i]-(n-i)*a+(n-i+1)*(n-i)/2*b); } cout<