#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main(){
	int N, P, Q, i;
	scanf("%lld%lld%lld", &N, &P, &Q);
	vector<int> C(N);
	int cons = 0, sum = 0;
	for(i = 0; i < N; i++){
		scanf("%lld", &C[i]);
		C[i] += i * P;
		cons += i * P;
		sum += C[i];
	}
	int ans = sum;
	sort(C.begin(), C.end());
	for(i = 0; i < N; i++){
		sum -= C[i];
		ans = max(ans, sum + (i + 1) * (Q + i) * P);
	}
	printf("%lld\n", ans - cons);
	return 0;
}
