#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long int ll;
static const int MAX_N = 500000;

int N; ll P, Q;
ll C[MAX_N];

int main(){
	scanf("%d %lld %lld", &N, &P, &Q);
	ll sum = 0LL;
	for(int i = 0; i < N; i++){
		scanf("%lld", &C[i]);
		C[i] += (ll)i * P;
		sum += C[i];
	}
	sort(C, C + N);
	ll res = sum;
	for(int i = 1; i <= N; i++){
		sum -= C[i - 1];
		sum += (Q + 2LL * (ll)(i - 1)) * P;
		res = max(res, sum);
	}
	res -= P * (ll)N * (ll)(N - 1) / 2LL;
	printf("%lld\n", res);
	return 0;
}
