
#include <iostream>
#include <algorithm>
using namespace std;
using LL = long long;
LL N;
LL P, Q;
LL C[567890];
LL E[567890];

int main() {
	cin >> N >> P >> Q;
	for (int i = 0; i < N; ++i) {
		cin >> C[i];
		E[i] = C[i] - P * (Q + i + 2 * (N - 1 - i));
	}
	sort(E, E + N);
	for (int i = N - 1; i >= 0; --i) {
		E[i] += E[i + 1];
	}
	LL V = P * (Q * N + (N - 1) * N / 2);
	LL ans = V;
	for (LL K = 1; K <= N; ++K) {
		ans = max(ans, V + K * (K - 1) * P + E[N - K]);
	}
	cout << ans << endl;
	return 0;
}
