#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N, P, Q;
  cin >> N >> P >> Q;
  vector<long long int> C(N);
  for (int i = 0; i < N; ++i) {
    cin >> C[i];
  }
  long long int ng = -1, ok = N + 1, ans = 0;
  while (ok - ng > 1) {
    int m = (ok + ng) / 2, t = m;
    for (int i = N - 1; i >= 0; --i) {
      if (C[i] - 2 * P * max(0LL, N - 1 - i - m + t - 1) >
          P * (Q + i - 2 * max(0, t - 1)))
        --t;
      if (t > 0)
        ok = m;
      else
        ng = m;
    }
  }
  int t = ng;
  for (int i = N - 1; i >= 0; --i) {
    if (C[i] - 2 * P * max(0LL, N - 1 - i - ng + t - 1) >
        P * (Q + i - 2 * max(0, t - 1))) {
      --t;
      ans += C[i];
    } else
      ans += P * (Q + i - 2 * t);
  }
  cout << ans << endl;
  return 0;
}
