#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;

#define whole(xs) (xs).begin(),(xs).end()

typedef long long Long;

template<class T>
istream& operator>>(istream& is, vector<T>& xs) {
    for (int i = 0; i < xs.size(); i++) is >> xs[i];
    return is;
}
template<class T>
ostream& operator<<(ostream& os, vector<T>& xs) {
    if (xs.empty()) return os << "[]";
    os << "[" << xs[0];
    for (int i = 1; i < xs.size(); i++) os << " " << xs[i];
    return os << "]";
}

Long N, P, Q;
vector<Long> C;
int main() {
    cin >> N >> P >> Q;
    C.clear(); C.resize(N);
    cin >> C;

    for (int i = 0; i < N; i++) {
        C[i] += P * i;
    }

    sort(whole(C), greater<Long>());
    Long A = 2 * P * N * (N - 1) / 2 + P * Q * N;
    Long Ans = A;
    for (int i = 0; i < N; i++) {
        A += C[i] - P * (Q + 2 * (N - 1 - i));
        Ans = max(Ans, A);
    }
    cout << Ans - P * N * (N - 1) / 2 << endl;

}