#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, P, Q;
  vector<int> C;
  cin >> N >> P >> Q;
  C = vector<int>(N);
  long long zenbugaishoku = 0;
  for (int i = 0; i < N; i++) {
    cin >> C[i];
    zenbugaishoku += C[i];
  }
  vector<long long> A(N);
  for (int i = 0; i < N; i++) {
    A[i] = C[i] - (Q - i) * P;
  }
  sort(A.begin(), A.end());
  long long Answer = zenbugaishoku;
  long long sum = zenbugaishoku;
  for (int i = 0; i < N; i++) {
    sum -= A[i];
    sum += 2 * i * P;
    Answer = max(sum, Answer);
  }
  cout << Answer << endl;
  return 0;
}
