#include <bits/stdc++.h>
#define int long long
using namespace std;


int N, P, Q;
int C[500010];
int a[500010];


signed main(){
    cin >> N >> P >> Q;
    for(int i = 0;i < N;i++) cin >> C[i];

    for(int i = 0;i < N;i++) a[i] = C[i]+P*(i+1);
    sort(a, a+N);

    int ans = accumulate(C, C+N, 0LL), s = ans, pre = 0;
    for(int i = 1;i <= N;i++){
        pre += a[i-1];
        ans = max(ans, s-pre+P*i*(Q+i));
    }

    cout << ans << endl;

    return 0;
}
