#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
#define MOD 1000000007ll
#define INF 1000000000ll
#define EPS 1e-7
#define FOR(i,n,m) for(ll i=n;i<(ll)m;i++)
#define REP(i,n) FOR(i,0,n)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ALL(v) v.begin(),v.end()
#define UNIQUE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end());
#define pb push_back

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n,p,q;
	cin>>n>>p>>q;
	vector<ll> c(n);
	REP(i,n) cin>>c[i];
	ll sum=0;
	REP(i,n) sum+=c[i];
	ll ans=sum;
	vector<ll> diff(n);
	REP(i,n) diff[i]=p*(q-i)-c[i];
	sort(ALL(diff));
	ll buf=0;
	FOR(i,1,n+1) {
		buf+=diff[n-i]+2*p*(i-1);
		ans=max(ans,sum+buf);
	}
	cout<<ans<<endl;
	return 0;
}

