#include <iostream>
#include <vector>
#include <queue>

using namespace std;
using ll = long long;

int main()
{
    ll N, P, Q;
    cin >> N >> P >> Q;
    vector<ll> D(N);
    priority_queue<ll> q;
    for (ll i = 0; i < N; i++) {
        cin >> D[i];
        D[i] += i * P;
        q.push(D[i]);
    }

    vector<ll> calc(N + 1);
    calc[0] = N * (N - 1) / 2;
    for (ll i = 1; i <= N; i++) {
        calc[i] = calc[i - 1] - (N - i) * 2;
    }
    for (ll i = 0; i <= N; i++) {
        calc[i] = (N - i) * P * Q + P * calc[i];
    }
    ll sum = 0;
    for (int i = 1; i <= N; i++) {
        sum += q.top();
        q.pop();
        calc[i] += sum;
    }
    constexpr ll INF = 1LL << 60;
    ll maxi = -INF;
    for (ll i = 0; i <= N; i++) {
        maxi = max(maxi, calc[i]);
    }
    cout << maxi << endl;
    return 0;
}