#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;
#define fir first
#define sec second
#define IINF INT_MAX
#define LINF LLONG_MAX
#define pque(type) priority_queue<type,vector<type>,greater<type> >

int main(void){
	ll DP[500000][500000]={};//i??\????????§??§,j?????????
	ll N,P,Q;
	cin>>N>>P>>Q;
	ll C[500000];
	rep(i,N)cin>>C[i];
	ll max=0;
	rep(i,N){//?????\?????????
		rep(j,N){
			DP[i][j]=max(DP[i-1][j]+C[i],DP[i-1][j-1]+(Q+(i-1)-2*j)*P);
			if(i==N-1 || max<DP[i][j])max=DP[i][j];
		}
	}
	cout<<max<<endl;
	return 0;
}