#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]; int Y(int i){ return 1.0*(dp[i]+i*a+1.0*(i*i+i)/2*b); } 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)); } 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<