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

using ll=long long;
int main(){
    ll n,p,q;
    cin>>n>>p>>q;
    vector<ll> c(n);
    for(int i=0;i<n;i++) cin>>c[i];

    vector<ll> dem(n);
    for(ll i=0;i<n;i++){
        dem[i]=p*i+c[i];
    }
    sort(dem.begin(),dem.end());
    ll sum=accumulate(c.begin(),c.end(),0LL);
    ll res=sum;
    ll dsum=0;
    for(ll i=0;i<n;i++){
        dsum+=dem[i];
        ll m=i+1;
        ll sc=sum+m*p*q+p*m*(m-1)-dsum;
        res=max(res,sc);
    }
    cout<<res<<endl;
    return 0;
}
