#include<iostream>
#include<vector>
#include<algorithm>
#define ll long long

using namespace std;

int main() {
    int N;ll P, Q;
    ll now=0, ans,tmp;
    cin >> N >> P >> Q;
    vector<ll> vect(N); 
    vector<ll> dp(N,0),dp_old(N,0);
    for(int i=0; i< N; i++){
        cin >> tmp;
        vect[i] =  P*(Q-i) - tmp ;
        now+=tmp;
    }
    ans = now;
    sort(vect.begin(),vect.end(), greater<ll>());
    for(int i=0; i<N ; i++){
        now += vect[i] + 2*P*i;
        ans = max(ans,now);
    }
    cout << ans << endl;
    return 0;
}

