#include <iostream>
#include <vector>
#include <queue>
using namespace std;

int main(){
    int64_t N,P,Q;
    cin>>N>>P>>Q;
    priority_queue<int64_t> que;

    int64_t sum = 0;
    for(int i=0;i<N;i++){
        int64_t C;
        cin>>C;
        sum+=C;
        que.push(P*(Q-i)-C);
    }
    int64_t ans = sum;
    for(int D=0;D<N;D++){
        int64_t t = que.top(); que.pop();
        sum+=t+D*2*P;
        //cout<<t<<' '<<D*2*P<<' '<<sum<<endl;
        ans=max(ans,sum);
    }
    cout<<ans<<endl;
    return 0;
}