#include <bits/stdc++.h>
#define int long long
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;

int n,P,Q,c[1114514],s,ans,x[1114514];

signed main(){
	cin>>n>>P>>Q;
	r(i,n){
		scanf("%ld",&c[i]);
		x[i]=(Q-i)*P-c[i];
		s+=c[i];
	}
	sort(x,x+n,greater<int>());
	ans=s;
	r(i,n){
		s+=x[i];
		s+=2*i*P;
		ans=max(ans,s);
	}
	cout<<ans<<endl;
}
