#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
typedef long long ll;

int n;
ll p,q;
ll c[500001];

int main(void){
	scanf("%d %lld %lld",&n,&p,&q);
	ll all=0;
	ll minus=0;
	for(int i=0;i<n;i++){
		scanf("%lld",&c[i]);
		c[i]+=(ll)p*i;
		minus+=(ll)p*i;
		all+=c[i];
	}
	sort(c,c+n);
	ll res=all;
	for(int i=0;i<n;i++){
		all+=(p*q-c[i]);
		res=max(res,all);
		q=q+2LL;
	}
	printf("%lld\n",res-minus);
	return 0;
}