const int MAXN = 500500;
int C[MAXN];

int main() {
    int N;
    ll P, Q;
    cin >> N >> P >> Q;
    ll sum = 0;
    vector<pair<ll, int> > ps;
    for (int i = 0; i < N; i++) {
        cin >> C[i];
        sum += C[i];
        ps.emplace_back(C[i]+P*i, i);
    }
    sort(ps.begin(), ps.end());
    ll ans = -1ll<<55;
    for (int i = 0; i <= N; i++) {
        ans = max(ans, sum+P*i*(i-1)+P*Q*i);
        if (i < N) {
            sum -= C[ps[i].second] + P*ps[i].second;
        }
    }
    cout << ans << endl;
    return 0;
}
