#include<cstdlib>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<cstring>
#include<cmath>
using namespace std;
const int MAXN = (int) 5e5 + 10;
const int INF = (int) 0x3f3f3f3f;
typedef long long LL;

LL N,P,Q;
LL C[MAXN];

void work(){
    scanf("%lld%lld%lld",&N,&P,&Q);
    for(int i=0;i<N;i++) scanf("%lld",&C[i]);
    LL ans=(LL)P*(N*(2*Q+N-1)/2);
//    printf("ans = %lld\n",ans);
    for(int i=0;i<N;i++) C[i]=C[i]-P*(Q+i)-2*P*(N-1-i);
//    for(int i=0;i<N;i++) printf("%lld ",C[i]);
//    printf("\n");
    sort(C,C+N);
//    for(int i=0;i<N;i++) printf("%lld ",C[i]);
    LL ret=ans;
    for(int i=0;i<N;i++){
        ans+=C[N-1-i]+P*i*2;
        ret=max(ret,ans);
    }
    printf("%lld\n",ret);
}

int main(){
#ifdef NNever
    freopen("data.in","r",stdin);
//    freopen("out.txt","w",stdout);
#endif // NNever
    work();
    return 0;
}

