#if 0
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2642
17:05-

#endif

#include <iostream>
#include <algorithm>
#include <limits.h>
#include <stdint.h>
using namespace std;

//pair<int, int> c[500010];
long long c[500010];

#define REP(var, start, count) for(long long var=start; var<count; var++)

int main(void) {
	
	int n, p, q;
	
	
	
	cin >> n >> p >> q;
	
	long long zisui = (long long)p * q;
	long long ztotal = 0;
	
	REP(i, 0, n) {
		int ccc;
		cin >> ccc;
		c[i] = ccc-zisui; //????????????????????¨??§????????????????????????
		
		ztotal += zisui;
		zisui -= p;
		//if ( i%100 == 0 ) { cerr << "i " << i << " c[i] " << c[i] << " ztotal " << ztotal << endl; }
	}
	//cerr << "ztotal " << ztotal << endl;
	
	sort(c, c+n);
	reverse(c, c+n);
	
	long long max = LLONG_MIN;
	
	long long sum = 0;
	
	for(long long day=0; day<=n; day++) { //?????\????£???????????????????
		
		if ( day != 0 ) {
			sum += c[day-1];
		}
		
		long long zisuiday = n-day;
		long long bonus = p * (zisuiday)*(zisuiday-1);
		if (zisuiday <= 1) { bonus = 0; }
		
		long long ret = sum + bonus + ztotal;
		//if(zisuiday<10 || day<10 ||day%100==0) { cerr << "day " << day << " bonus " << bonus << " sum " << sum << " ret " << ret << endl; }
		
		if ( ret > max ) { max = ret; }
	}
	
	cout << max << endl;
	
	return 0;
}