#include <iostream>
#include <algorithm>

using namespace std;
long long c[500010];
int main(){
	long long i,n,p,q,ans = -10000000000000000,val = 0,val1 = 0;
	cin >> n >> p >> q;
	for(i=1;i<=n;i++){
		long long a; cin >> a;
		c[i - 1] = a + p*i;
		val += a;
	}
	sort(c,c + n);
	ans = max(ans,val);
	for(i=1;i<=n;i++){
		val1 += c[i - 1];
		ans = max(ans,val - val1 + p*i*(q + i));
	}
	cout << ans << endl;
}
