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

#define max(a,b) ((a)>(b)?(a):(b))

typedef long long LL

int main(){
  int n,p,q;
  cin >> n >> p >> q;
  vector<int> c(n);
  for(int i=0;i<n;i++){
    cin >> c[i];
    c[i]+=i*p;
  }
  sort(c.begin(),c.end(),greater<int>());
  LL ans=(q*n+n*(n-1)/2)*p;
  LL ruiseki=0;
  for(int i=0;i<n;i++){
    ruseki+=c[i];
    ans=max(ans,ruiseki+(q*(i+1)+(n-i-2)*(n-i-1))*p-(n*(n-1)/2)*p);
  }
  cout << ans << endl;
  return 0;
}
