#if 0

#endif
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <assert.h>
#include <complex>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
ll Max, N, P, Q;
ll C[501000];
ll diff_by_min[501000];
void setup() {
    cin >> N >> P >> Q;
    for (int i = 0; i < N; ++i) {
        cin >> C[i];
    }
}
void calc_diff_by_min() {
    for (int i = 0; i < N; ++i) {
        diff_by_min[i] = (Q - i) * P  - C[i];
    }
}
ll max_diff_by_jisui() {
    ll max_diff = 0;
    ll now_diff_by_min = 0;

    sort(diff_by_min, diff_by_min + N);

    for (ll i = 0; i < N; ++i) {
        now_diff_by_min += diff_by_min[N - i - 1];
        ll bonus = i * (i + 1) * P;

        max_diff = max(
            max_diff, now_diff_by_min + bonus);
    }

    return max_diff;
}
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    #define ll int

    setup();

    // Calculate the quality of life when he always eats out.
    for (int i = 0; i < N; ++i) {
        Max += C[i];
    }

    calc_diff_by_min();

    cout << Max + max_diff_by_jisui() << endl;

    return 0;
}
