#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void){
    // Your code here!
    ll N, P, Q;
    cin>>N>>P>>Q;
    vector<ll>vec;
    ll sum = 0;
    for(ll i=0LL;i<N;i++){
        ll C;
        cin>>C;
        sum += C;
        vec.push_back(P*i+C);
    }
    sort(vec.begin(), vec.end());
    for(int i=1;i<vec.size();i++)vec[i]+=vec[i-1];
    ll ans = sum;
    for(ll k=1;k<=N;k++)ans=max(ans, sum+k*P*Q+P*k*(k-1)-vec[k-1]);
    cout<<ans<<endl;
    return 0;
}

