#include<bits/stdc++.h>
using namespace std;
#define M 1<<25
long long a[M],b[M],c[M],x[M],n,p,q,sum,maxn;
int main() {
    cin>>n>>p>>q;c[0]=p*q;
    for(int i=0;i<n;i++){cin>>b[i];a[i]=b[i]-(q-i)*p;sum+=b[i];}
    sort(a,a+n);maxn=sum;
    for(int i=0;i<n;i++){
        sum-=a[i];
        sum+=2*i*p;
        maxn=max(sum,maxn);
    }
    cout<<maxn<<endl;
}