#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(){
  cin.tie(0); ios::sync_with_stdio(0);
  ll n,p,q;
  cin >> n >> p >> q;
  priority_queue<ll> pq;
  vector<ll> c(n);
  rep(i,n){
    cin >> c[i];
    pq.push(c[i] - (q+i)*p - (n-1-i)*2*p);
  }

  ll res = p*(n*q + n*(n-1)/2), sum = res, k = 0;
  while(pq.size()){
    ll x = pq.top(); pq.pop(); k++;
    //cout << x << endl;
    sum += x;
    res = max(res, sum + k*(k-1)*p);
  }
    
  cout << res << endl;
}