#include<iostream>
#include<algorithm>
using namespace std;
long long b[1000000], a[1000000], c[1000000], x[1000000], n, p, q, sum, maxn;
int main() {
	cin >> n >> p >> q; c[0] = p*q;
	for (int i = 0; i < n; i++) { cin >> b[i]; a[i] = b[i] - (q - i)*p; sum += b[i]; }
	sort(a, a + n); maxn = sum;
	for (int i = 0; i < n; i++) {
		sum -= a[i];
		sum += 2 * i * p;
		maxn = max(sum, maxn);
	}
	cout << maxn << endl;
	return 0;
}