#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vd = vector<double>;
using vvd = vector<vd>;
template <typename T, typename F>
pair<T, T> tsearch(T lower, T upper, ll max_loop, F f) {
  for (ll _ = 0; _ < (max_loop); ++_) {
    T nl = (lower * 2 + upper) / 3;
    T nu = (lower + upper * 2) / 3;
    if (f(nl) > f(nu)) {
      upper = nu;
    } else {
      lower = nl;
    }
  }
  return {lower, upper};
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(50);
  ll n, p, q;
  cin >> n >> p >> q;
  vl c(n);
  for (ll i = 0; i < (n); ++i) cin >> c[i];
  auto f = [&](ll x) {
    ll power = q;
    ll sum = 0;
    for (ll i = 0; i < (n); ++i) {
      if (n - i == x || c[i] <= p * x * 2 + power * p) {
        sum += power * p;
        power++;
        x--;
      } else {
        power--;
        sum += c[i];
      }
    }
    return sum;
  };
  auto x = tsearch(0ll, n, ((ll)1e3), f);
  ll ans = -((ll)1e10);
  for (ll i = x.first; i < (ll)x.second + 1; i++) ans = max(ans, f(i));
  cout << ans << endl;
  return 0;
}
