#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-10;
const double PI = acos(-1.0);
const long long INF = 1e15;
long long N, P, Q;
long long C[500010];
long long calc(long long k) {
  long long q = Q + 2 * k - N, h = 0;
  for (int i = N - 1; i >= k; --i) {
    if (k > 0) {
      if (C[i] < P * (q - 1)) {
        h += P * (q - 1);
        --q;
        --k;
      } else {
        h += C[i];
        ++q;
      }
    } else {
      h += C[i];
      --q;
    }
  }
  for (int i = k - 1; i >= 0; --i) {
    h += P * (q - 1);
    --q;
  }
  return h;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cin >> N >> P >> Q;
  for (int i = (0); i < (N); ++i) cin >> C[i];
  long long ans = -INF;
  long long lb = 0, ub = N;
  while (ub - lb > 2) {
    long long k1 = (lb * 2 + ub) / 3;
    long long k2 = (lb + ub * 2) / 3;
    long long h1 = calc(k1), h2 = calc(k2);
    if (h1 < h2) {
      lb = k1;
      ans = max(ans, h2);
    } else {
      ub = k2;
      ans = max(ans, h1);
    }
  }
  ans = max(ans, calc(lb));
  ans = max(ans, calc(ub));
  ans = max(ans, calc((lb + ub) / 2));
  cout << ans << endl;
  return 0;
}
