d[i][j]:=第i个月雇佣j名工人的最小开支
#include <bits/stdc++.h>
using namespace std;
int h,s,f;
int dd(int data)
{
if (data==0) return 0;
if (data<0) return -f*data;
if (data>0) return h*data;
}
int main()
{
int n;
while(~scanf("%d",&n)&&n){
scanf("%d%d%d",&h,&s,&f);
int a[14];
memset(a,0,sizeof(a));
for (int i=1;i<=n;i++) scanf("%d",&a[i]);
int d[14][102];
memset(d,0,sizeof(d));
for (int i=0;i<=100;i++){
d[0][i]=i*h;
}
for (int i=1;i<=n;i++){
for (int j=a[i];j<=100;j++){
int ans=1<<30;
for (int k=a[i-1];k<=100;k++){
ans=min(ans,d[i-1][k]+dd(j-k)+j*s);
}
d[i][j]=ans;
}
}
int minn=1<<30;
for (int j=a[n];j<=100;j++){
minn=min(minn,d[n][j]);
}
printf("%d\n",minn);
}
return 0;
}