#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(long long i=0; i<(n); i++)
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }


int main(){
    ll n,p,q; cin>>n>>p>>q;
    vector<ll> c(n);
    rep(i,n) cin>>c[i];
    rep(i,n) c[i] += p * i;
    sort(c.begin(), c.end(), greater<ll>());
    vector<ll> csum(n+1);
    csum[0] = 0;
    rep(i,n) csum[i+1] = csum[i] + c[i];
    ll res = -1e18;
    for(ll k = 0; k <= n; k++){
        ll tmp = csum[n-k] + p*q*k;
        tmp += p * k * (k-1);
        chmax(res, tmp);
    }
    cout << res - p*n*(n-1)/2 << endl;
    return 0;
}
