#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-15
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
ll N,P,Q;
ll C[500100];
vector<ll> vec;
int main(){
	scanf("%lld %lld %lld",&N,&P,&Q);
	ll sum = 0;
	for(int i=0;i<N;i++){
		scanf("%lld",&C[i]);
		sum += C[i];
		vec.pb(P*i+C[i]);
	}
	sort(all(vec));
	for(int i=1;i<vec.size();i++)vec[i]+=vec[i-1];
	ll ans = sum;
	for(int i=1;i<=N;i++)chmax(ans,sum+i*P*Q+P*i*(i-1)-vec[i-1]);
	cout << ans << endl;
	return 0;
}