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

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

typedef long long LL;

int main(){
  LL n,p,q;
  cin >> n >> p >> q;
  vector<LL> 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(LL i=0;i<n;i++){
    ruiseki+=c[i];
    ans=max(ans,ruiseki+(q*(n-i-1)+(n-i-2)*(n-i-1))*p-(n*(n-1)/2)*p);
  }
  cout << ans << endl;
  return 0;
}
