#include <bits/stdc++.h>
using namespace std;
using LL = long long;
int N;
LL P, Q;
LL C[567890];
LL E[567890];
int main() {
  cin >> N >> P >> Q;
  for (int i = 0; i < N; ++i) {
    cin >> C[i];
    E[i] = C[i] - P * (Q + i + 2 * (N - 1 - i));
  }
  sort(E, E + N);
  for (int i = N - 1; i >= 0; --i) {
    E[i] += E[i + 1];
  }
  LL V = P * (Q * N + (N - 1) * N / 2);
  LL ans = V;
  for (LL K = 1; K <= N; ++K) {
    LL can = V + K * (K - 1) * P + E[N - K];
    ans = max(ans, can);
  }
  cout << ans << endl;
  return 0;
}
