#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
using pll = pair<long long,long long>;
constexpr int INF = 1e9;
constexpr long long LINF = 1e17;
constexpr int MOD = 1000000007;

int main(){
    ll n,p,q;
    cin >> n >> p >> q;
    vector<int> c(n);
    ll ans = 0;
    rep(i,n){
        cin >> c[i];
        ans += c[i];
    }
    vector<ll> score(n);
    rep(i,n) score[i] = c[i] + p * i;
    sort(score.begin(),score.end());
    rep(i,n) score[i] = 2*p*i + p*q - score[i];
    rep(i,n-1) score[i+1] += score[i];
    ll mx = 0;
    rep(i,n){
        mx = max(mx,score[i]);
    }
    ans += mx;
    cout << ans << endl;
    return 0;
}
