#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
#define D10 fixed<<setprecision(10)
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/

int main()
{
	ll n, p, q;
	cin >> n >> p >> q;
	vector<ll> v;
	ll sum = 0;
	REP(i, n)
	{
		ll c; cin >> c;
		v.push_back(c + p*i);
		sum += c;
	}
	sort(ALL(v));
	ll ans = LLONG_MIN;
	ll tmp = 0;
	REP(i, n + 1)
	{
		ll t = sum + p*i*(q + i - 1) - tmp;
		if(i!=n) tmp += v[i];
		chmax(ans, t);
	}
	cout << ans << endl;
	return 0;
}