#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int N,P,Q;
int C[555555];

signed main(){
    scanf("%lld%lld%lld",&N,&P,&Q);

    rep(i,N)scanf("%lld",&C[i]);

    int val=accumulate(C,C+N,0ll);
    int ans=val;
    vector<int>dif;
    rep(i,N){
        dif.pb((Q-i)*P-C[i]);
    }
    sort(all(dif));reverse(all(dif));

    for(int i=0;i<N;i++){
        val+=dif[i];
        chmax(ans,val+i*(i+1)*P);
    }
    cout<<ans<<endl;
    return 0;
}