#include <bits/stdc++.h>
#define INF 100000000000000000ll
using namespace std;
typedef long long int ll;

int main()
{
	ll N, P, Q, res = -INF, tmp = 0;
	cin >> N >> P >> Q;
	vector<ll> C(N), add(N);
	for (int i = 0; i < N; i++) {
		cin >> C[i];
		tmp += C[i];
	}
	for (int i = 0; i < N; i++) {
		add[i] = Q * P - C[i] - i * P;
	}
	sort(add.begin(), add.end());
	res = max(res, tmp);
	for (int i = 0; i < N; i++) {
		tmp += add[N - 1 - i] + P * i * 2;
		res = max(res, tmp);
	}
	cout << res << endl;
	return 0;
}