#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long N, P, Q;
  cin >> N >> P >> Q;
  long long C[500002];
  for (int i = ((int)(1)); i <= ((int)(N)); i++) cin >> C[i];
  long long DP[N][N];
  DP[1][0] = C[1];
  DP[1][1] = Q * P;
  long long ans = LLONG_MIN;
  if (N == 1) ans = max(DP[1][0], DP[1][1]);
  for (int i = ((int)(2)); i <= ((int)(N)); i++) {
    for (int j = ((int)(0)); j <= ((int)(i)); j++) {
      if (j == 0) {
        DP[i][j] = DP[i - 1][j] + C[i];
      } else if (i == j) {
        DP[i][j] = DP[i - 1][j - 1] + (Q - (i - 1) + 2 * (j - 1)) * P;
      } else {
        DP[i][j] = max(DP[i - 1][j] + C[i],
                       DP[i - 1][j - 1] + (Q - (i - 1) + 2 * (j - 1)) * P);
      }
      if (i == N && DP[i][j] > ans) ans = DP[i][j];
    }
  }
  cout << ans << endl;
  return 0;
}
