#include <bits/stdc++.h>
using namespace std;
long long N, P, Q;
long long C[500001];
int main() {
  int n, k;
  cin >> N >> P >> Q;
  for (int i = 1; i <= N; i++) cin >> C[i];
  long long ans = -1e+15;
  for (n = 0; n <= N; n++) {
    long long happy = 0;
    long long jisuiP = P * Q;
    int jisuiDay = n;
    for (k = 1; k <= N; k++) {
      long long botti = 2 * P * jisuiDay;
      long long turai = C[k] - jisuiP;
      if (botti < turai) {
        happy += C[k];
        jisuiP -= P;
      } else {
        happy += jisuiP;
        jisuiP += P;
        jisuiDay--;
      }
    }
    ans = max(ans, happy);
  }
  cout << ans << endl;
  return 0;
}
