#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <limits>
#include <numeric>
using namespace std;
using ll = long long;
constexpr ll LLMIN = numeric_limits<ll>::min();

int main() {
    ll n, p, q;
    cin >> n >> p >> q;
    vector<ll> c(n);
    vector<ll> csum(n);
    for(int i=0; i<n; ++i) {
        cin >> c[i];
        csum[i] = c[i] + i*p;
    }
    ll res = accumulate(c.begin(), c.end(), 0ll);
    ll tmp = res;
    sort(csum.begin(), csum.end());
    for(int i=0; i<n; ++i) {
        tmp += p*q - csum[i] + 2*i*p;
        res = max(res, tmp);
    }
    cout << res << endl;
}
