#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(v) v.begin(), v.end()
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++) 
#define Rep(n) for (ll _ = 0; _ < (ll)(n); _++) 
#define fs first
#define sc second

int main(void){
	ll n,p,q;
	cin >> n >> p >> q;
	vector<ll> c(n);
	ll s =  0;
	rep(i,n){
		ll tmp;
		cin >> tmp;
		s += tmp;
		c[i] = p * i + tmp;
	}
	sort(all(c));
	ll ans = s;
	for(int k=1; k<=n; k++){
		s -= c[k-1];
		ans = max(ans, s + k * p * q + p * k * (k-1));
	}
	cout << ans << endl;
}
