#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> Pa;

int main(){
    ll N,P,Q;
    cin >> N >> P >> Q;
    vector<ll> C(N);
    vector<Pa> v(N);
    for(ll i=0;i<N;i++){
        cin >> C[i];
        v[i] = {C[i]+P*i,i};
    }
    sort(v.begin(),v.end(),greater<Pa>());
    ll ans = P*N*Q+P*N*(N-1)/2,now = ans;
    for(ll i=0;i<N;i++){
        ll id = v[i].second;
        now += C[id]+P*id-P*Q-2*(N-1-i)*P;
        ans = max(ans,now);
    }
    cout << ans << endl;
}
