#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
constexpr ld EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr int MOD = 1e9 + 7;

template <typename T>
void printv(const vector<T> &v)
{
    int sz = v.size();
    for (int i = 0; i < sz; i++)
    {
        cout << v[i] << " \n"[i == sz - 1];
    }
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll N, P, Q;
    cin >> N >> P >> Q;
    vector<ll> C(N);
    priority_queue<ll> que;
    ll csum = 0;
    for (ll i = 0; i < N; i++)
    {
        cin >> C[i];
        que.push(-(P * i + C[i]));
        csum += C[i];
    }
    ll ret = csum, sum = 0;
    for (ll i = 1; i <= N; i++)
    {
        sum += que.top();
        que.pop();
        ll tmp = csum + i * P * Q + P * i * (i - 1) + sum;
        ret = max(ret, tmp);
    }
    cout << ret << endl;
}

