#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

ll N,P,Q;
ll C[500010];
ll idx[500010];
ll sum=0;

int main(){
  cin>>N>>P>>Q;
  rep(i,N){
    cin>>C[i];
    sum+=C[i];
  }
  rep(i,N)idx[i]=i;
  sort(idx,idx+N,[=](const int& a,const int& b){ return P*a+C[a] < P*b+C[b]; });
  ll res=-INF;
  rep(i,N){
    maxch(res,sum+P*Q*i+P*i*(i-1));
    sum-=P*idx[i]+C[idx[i]];
  }
  maxch(res,sum+P*Q*N+P*N*(N-1));
  cout<<res<<endl;
  return 0;
}

