#include <bits/stdc++.h>

using namespace std;

#define int long long
typedef long long ll;

const ll inf = 1e18;

ll S = 0;
ll N, P, Q;
vector<ll> C;
vector<ll> v;
ll f(ll t) {
	ll res = (t * (t - 1) / 2) * 2 * P + S;
	for (int i = 0; i < t; ++i) {
		res += v[i];
	}
	return res;
}
signed main() {
	cin >> N >> P >> Q;
	C.resize(N);
	for (int i = 0; i < N; ++i) {
		cin >> C[i];
	}

	S = 0;
	for (int i = 0; i < N; ++i) {
		S += C[i];
	}
	for (int i = 0; i < N; ++i) {
		v.push_back((Q - i) * P - C[i]);
	}
	sort( v.begin(), v.end(), greater<ll>() );

	ll now = S;
	ll ans = now;
	for (int i = 0; i < N; ++i) {
		now += i * 2 * P;
		now += v[i];
		ans = max(ans, now);
	}
	cout << ans << endl;

	/*
	ll l = 0, r = N;
	for (int t = 0; t < 100; ++t) {
		ll m1 = l+(r-l)/3, m2 = l+(r-l)*2/3;
		if ( f(m1) < f(m2) ) {
			l = m1;
		}
		else if ( f(m1) > f(m2) ) {
			r = m2;
		}
		else if ( f(l) < f(m1) ) {
			l = m1;
		}
		else {
			r = m2;
		}
	}
	assert(m2-m1 < 3);
	*/
	/*
	ll ans = l;
	for (ll i = l; i <= r; ++i) {
		if ( f(i) > f(ans) ) ans = i;
	}
	*/
//	cout << f(1) << endl;
//	cout << ans << " " << f(ans) << endl;
//	cout << f(ans) << endl;
}