#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
int main(){
    ll n,p,q,C[500001],ans=0,temp=0;
    cin>>n>>p>>q;
    rep(i,n) cin>>C[i],ans+=C[i];
    vec A;
    rep(i,n) A.push_back(p*q-C[i]),q--;
    sort(all(A),greater<int>());
    temp=ans;
    rep(i,n) temp=temp+A[i]+2*p*i,ans=max(ans,temp);
    cout<<ans<<"\n";
}
