#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\b.answer"

long long int N, P, Q;


int main() {
	cin >> N >> P >> Q;
	vector<long long int>cs(N);
	for (int i = 0; i < N; ++i) {
		cin >> cs[i];
	}
	int amin = 0;
	int amax = N + 1;
	vector<long long int>totals(cs);
	for (int i = 0; i < cs.size(); ++i) {
		totals[i] = -totals[i] - i*P;
	}
	sort(totals.begin(), totals.end(), greater<long long int>());
	long long int ans = accumulate(cs.begin(), cs.end(), 0ll);
	long long int now = ans;
	for (int i = 0; i < totals.size(); ++i) {
		long long int plus = totals[i] + (Q+i*2) * P;
		now += plus;
		ans = max(ans, now);
	}
	cout << ans << endl;
	return 0;
}