#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
#define Maxn 500010
int n;
long long p, q, c[Maxn], d[Maxn], Sig, Res, Tab;
int main()
{
    scanf("%d%lld%lld", &n, &p, &q);
    for (int i=1; i<=n; i++)
    {
        scanf("%lld", &c[i]); Sig+=c[i];
        d[i]=c[i]-(q-i+1)*p;
    }
    sort(d+1, d+n+1);
    Res = Sig;
    for (int i=1; i<=n; i++)
    {
        Sig-=d[i]; Tab+=p*((i-1)<<1);
        Res=max(Res, Sig+Tab);
    }
    printf("%lld\n", Res);
}

