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