#include <iostream>
#include <vector>
#include <algorithm>
#define int long long
using namespace std;

typedef pair<int,int> P;

signed main(){
	int n,p,q,c[500000],sum = 0,ma;
	vector<P> vec;
	cin >> n >> p >> q;
	for(int i = 0;i < n;i++){
		cin >> c[i];
		sum += c[i];
		vec.push_back(P(p * (q - i) - c[i],i));
	}
	ma = sum;
	sort(vec.begin(),vec.end(),greater<P>());
	for(int i = 1;i <= n;i++){
		sum += vec[i - 1].first;
		ma = max(ma,sum + p * i * (i - 1));
	}
	cout << ma << endl;
	return 0;
}