#include <bits/stdc++.h>
using namespace std;
vector<long long int> C;
vector<long long int> D;
int main(void) {
  long long int N, P, Q, i, x;
  long long ans = 0, gen = 0;
  scanf("%d %d %d", &N, &P, &Q);
  for (i = 0; i < N; i++) {
    scanf("%d", &x);
    x += i * P;
    C.push_back(x);
  }
  sort(C.begin(), C.end());
  for (i = 0; i < N; i++) {
    D.push_back(C[N - i - 1]);
  }
  gen = P * N * (Q + N - 1);
  ans = gen;
  for (i = 0; i < N; i++) {
    gen += D[i] - (2 * P * (N - 1 - i)) - P * Q;
    if (ans < gen) {
      ans = gen;
    }
  }
  ans -= P * (N - 1) * N / 2;
  printf("%lld\n", ans);
}
