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