#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;

//n????°?????????´??????DP[i][j]=i??\?????????????????§j?????????
//n?????§????????´???????????§????????¨?????¢????????????????????????????????§?????????????????°m?????????????£????????????????????????????????????????C[i]+(i-1)P?????§????????????????????§???C[i]+(i-1)P????°????????????????????????????
//??????????????????????????????????§£??????

int main(void){
	ll N,P,Q;
	scanf("%lld%lld%lld",&N,&P,&Q);
	ll C[500002],D[500002];
	ll C_sum=0;
	rep(i,N){
		scanf("%lld",&C[i]);
		C_sum+=C[i];
		C[i]+=i*P;
	}
	sort(C,C+N);//??????????????????????????¨???????????¨??????????????????
	D[0]=0;//???????´???????????±?????????????????????¨TLE??????
	rep(i,N){
		D[i+1]=D[i]+C[i];
	}
	ll sum;
	ll ans=LLONG_MIN;
	rep(m,N+1){//m?????????
		sum=C_sum;//?????\?£?????????????
		sum-=D[m];//?£??????????????????????????????¨??????????????????
		sum+=(m-1+Q)*P*m;//???????????????????£???£???
		if(ans<sum)ans=sum;
	}
	cout<<ans<<endl;
	return 0;
}