#include <cstdio>
#include <cstdint>
#include <vector>
#include <algorithm>
#include <utility>

int main() {
  size_t N;
  intmax_t P, Q;
  scanf("%zu %jd %jd", &N, &P, &Q);

  std::vector<intmax_t> C(N);
  intmax_t S = 0;
  for (auto& ci: C) {
    scanf("%jd", &ci);
    S += ci;
  }

  std::vector<intmax_t> D(N);
  for (size_t i = 0; i < N; ++i) {
    intmax_t j = i;
    D[i] = j*P + C[i];
  }
  std::sort(D.begin(), D.end());

  intmax_t res = S;
  intmax_t cur = res;
  for (size_t i = 0; i < N; ++i) {
    cur -= D[i];
    intmax_t j = i+1;
    cur += P*(Q+j+j-2);
    res = std::max(res, cur);
  }
  printf("%jd\n", res);
}

