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