#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <functional>
#include <queue>
#include <tuple>
#include <cstring>
#include <iomanip>
#include <algorithm>

using namespace std;

#define rep(i,n) for(int i = 0;i < n;i++)
#define each(i,n) for(auto i : n)
#define all(n) n.begin(),n.end()
#define clr(n) memset(n,0,sizeof(n))
#define mclr(n) memset(n,-1,sizeof(n))
#define int long long

signed main() {
	int n, p, q;
	cin >> n >> p >> q;
	vector<int> c(n);
	int dif = 0, sum = 0;;
	rep(i, n) {
		cin >> c[i];
		c[i] += i * p;
		dif += i * p;
		sum += c[i];
	}
	sort(all(c));
	int ans = sum - dif;
	rep(i, n) {
		sum -= c[i];
		sum += (q + i * 2) * p;
		ans = max(ans, sum - dif);
	}
	cout << ans << endl;

	return 0;
}