#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;
vector<long long int> cs;
long long int getans(const int now, const long long int selfrest) {
  if (now == cs.size())
    return 0;
  else {
    if (selfrest == 0) {
      return cs[now] + getans(now + 1, selfrest);
    } else {
      if (cs[now] > selfrest * P) {
        return cs[now] - selfrest * P + getans(now + 1, selfrest);
      } else {
        return getans(now + 1, selfrest - 1);
      }
    }
  }
}
long long int check(const long long int selfnum) {
  long long int ans = 0;
  ans += Q * P * selfnum + P * (selfnum) * (selfnum - 1) / 2;
  ans += getans(0, selfnum);
  return ans;
}
int main() {
  cin >> N >> P >> Q;
  for (int i = 0; i < N; ++i) {
    int c;
    cin >> c;
    cs.push_back(c);
  }
  int amin = 0;
  int amax = N;
  while (amin + 3 <= amax) {
    int amid1 = (amin * 2 + amax) / 3;
    int amid2 = (amin + amax * 2) / 3;
    long long int ans1 = check(amid1);
    long long int ans2 = check(amid2);
    if (ans1 < ans2) {
      amin = amid1;
    } else {
      amax = amid2;
    }
  }
  long long int ans = -1e18;
  for (int n = amin; n <= amax; ++n) {
    ans = max(ans, check(n));
  }
  cout << ans << endl;
  return 0;
}
