#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
const double EPS = 1e-9;
const ll mod = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;

ll n, p, q;
ll sum;
ll x[500001]; 

void solve() {
    cin >> n >> p >> q;
    rep(i,n) {
        ll c; cin >> c;
        sum += c;
        x[i] = p*i+c;
    }
    sort(x, x+n);
    ll ans = -linf;
    ll acc = 0;
    rep(i,n+1) {
        ll cnt = sum + i * p * q + (ll)i*(ll)(i-1)*p - acc;
        ans = max(ans, cnt);
        acc += x[i];
    }
    cout << ans << endl;
}

int main() {
#ifndef LOCAL
    ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
    cout.precision(20);
    cerr << fixed;
    cerr.precision(6);
#ifdef LOCAL
    //freopen("in.txt", "wt", stdout); //for tester
    freopen("in.txt", "rt", stdin);
#endif  
    solve();
    //cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    return 0;
}

