#include <iostream>
#include <vector>
#include <algorithm>

using namespace  std;

#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define vec vector
#define ll long long
int main(void)
{
	ll n, p, q;
	cin >> n >> p >> q;
	vec<ll> c(n);
	ll sum = 0;
	rep(i,n) {
		ll cc;
		cin >> cc;
		sum += cc;
		c[i] = p * (q - i) - cc;
	}
	sort(c.begin(), c.end());
	reverse(c.begin(), c.end());

	ll ret = sum;
	ll keep = sum;
	rep(i, n + 1) {
		ret = max(2 * p * i *  (i - 1) / 2 + keep, ret);
		keep += c[i];
	}
	cout << ret << endl;
	return 0;
}