#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
const double EPS = 1e-9;
typedef pair<int, int> P;
typedef unsigned int ui;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
int main() {
	int n; ll p,q; cin >> n >> p >> q;
	vector<ll> v; ll c; ll sum = 0;
	rep(i, n) {
		cin >> c;
		sum += c;
		v.push_back(c-p*(q-(ll)i));
	}
	sort(v.begin(), v.end());
	ll ma = sum;
	rep1(i, n) {
		sum -= v[i-1];
		sum += p * (ll)(i - 1)*(ll)2;
		ma = max(ma, sum);
	}
	cout << ma << endl;
	return 0;
}
