#include <iostream>
#include <cstdio>
#include <algorithm>
#include <utility>
#include <vector>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
typedef long long ll;

int N,M,H,W,K,A,B;
string S;
string alpha = "abcdefghijklmnopqrstuvwxyz";
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main() {
  int P,Q;
  cin>>N>>P>>Q;
  vector<int> c(N,0);
  rep(i,N) cin>>c.at(i);
  vector<pair<ll,ll> > cj(N,pair<ll,ll>(0,0));
  rep(i,N){
    cj.at(i).fi = c.at(i) + P * (i+1);
    cj.at(i).se = i+1;
  }
  sort(begin(cj),end(cj));
  vector<ll> ans(N+1,0);
  ll sumn=0;
  rep(i,N) sumn += c.at(i);
  rep(i,N+1){
    if(i == 0) {
      ans.at(0) = sumn;
      continue;
    }
    pair<ll,ll> p = cj.at(i-1);
    ans.at(i) = ans.at(i-1) - c.at(p.se-1) + P*(Q-p.se-1+2*i);
  }
  sort(begin(ans),end(ans));
  cout << ans.at(N) << endl;
}

