#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
typedef long long ll;

int main(){
  ll n,p,q,c;
  scanf("%lld%lld%lld",&n,&p,&q);
  vector<ll> x(n);
  rep(i,n){
    scanf("%lld",&c);
    x[i] = c - (q+i)*p - (n-1-i)*2*p;
  }
  sort(x.begin(),x.end());

  ll res = p*(n*q + n*(n-1)/2), sum = res;
  rep(i,n){
    sum += x[n-1-i];
    res = max(res, sum + p*i*(i+1));
  }
  printf("%lld\n",res);
}