#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)n;++i)

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 500005;

int main()
{
    int n,p,q;
    ll a[MAX_N];
	scanf("%d%d%d",&n,&p,&q);
	rep(i,n){
		scanf("%lld",&a[i]);
        a[i] += (ll)i*p;
	}
    sort(a,a+n);
    ll ch = 0;
    ll lh = 0;
    ll mx = 0;
    rep(k,n){
        lh += a[k];
        ch += (ll)p*(q + 2*k);
        if(ch - lh > mx){
            mx = ch-lh;
        }
    }
    ll sub = 0;
    rep(i,n-1){
        sub += (ll)(i+1)*p;
    }
    printf("%lld\n",accumulate(a,a+n,0LL) + mx - sub);
	return 0;
}