#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, P, Q;
  cin >> N >> P >> Q;
  int C[500000];
  for (int i = 0; i < N; i++) cin >> C[i];
  int X[500001];
  X[0] = Q * P;
  X[1] = C[0];
  for (int d = 1; d < N; d++) {
    X[d + 1] = X[d] + C[d];
    for (int i = d; i >= 1; i--) {
      int jisui, shokudo;
      jisui = X[i] + (Q + d - i * 2) * P;
      shokudo = X[i - 1] + C[d];
      X[i] = max(jisui, shokudo);
    }
    X[0] = X[0] + (Q + d) * P;
  }
  sort(X, X + (N + 1));
  cout << X[N];
  return 0;
}
