#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
template <class T>
using Table = vector<vector<T>>;
const ld eps = 1e-9;
long long int N, P, Q;
long long int getans(const int self, const vector<long long int>& vs) {
  vector<long long int> totals(vs);
  for (int i = 0; i < vs.size(); ++i) {
    totals[i] = -totals[i] - i * P;
  }
  sort(totals.begin(), totals.end(), greater<long long int>());
  long long int ans = 0;
  for (int i = 0; i < self; ++i) {
    ans += totals[i];
  }
  ans += self * (Q + (Q + 2 * (self - 1))) * P / 2;
  return ans;
}
int main() {
  cin >> N >> P >> Q;
  vector<long long int> cs(N);
  for (int i = 0; i < N; ++i) {
    cin >> cs[i];
  }
  int amin = 0;
  int amax = N + 1;
  while (amin + 2 <= amax) {
    const int amid1 = (amin * 2 + amax) / 3;
    const int amid2 = (amin + amax * 2) / 3;
    const long long int a1 = getans(amid1, cs);
    const long long int a2 = getans(amid2, cs);
    if (a1 < a2) {
      amin = amid1;
    } else {
      amax = amid2;
    }
  }
  long long int ans = 0;
  for (int s = amin; s < amax; ++s) {
    ans = max(ans, getans(s, cs));
  }
  ans += accumulate(cs.begin(), cs.end(), 0ll);
  cout << ans << endl;
  return 0;
}
