#include <bits/stdc++.h>
using namespace std;
using LLI = long long int;
using Pair = pair<LLI, int>;
int N;
LLI P;
LLI Q;
int size;
LLI cs[514514];
LLI lazy[1 << 20];
Pair seg[1 << 20];
void LazyPropagate(int k) {
  if (k < size - 1) {
    lazy[k * 2 + 1] += lazy[k];
    lazy[k * 2 + 2] += lazy[k];
  }
  seg[k].first += lazy[k];
  lazy[k] = 0;
}
void Update(int wishl, int wishr, int k, int watchl, int watchr, LLI x) {
  int mid;
  if (wishr <= watchl || watchr <= wishl) {
    LazyPropagate(k);
    return;
  }
  if (wishl <= watchl && watchr <= wishr) {
    lazy[k] += x;
    LazyPropagate(k);
    return;
  }
  LazyPropagate(k);
  mid = (watchl + watchr) / 2;
  Update(wishl, wishr, k * 2 + 1, watchl, mid, x);
  Update(wishl, wishr, k * 2 + 2, mid, watchr, x);
  seg[k] = max(seg[k * 2 + 1], seg[k * 2 + 2]);
}
Pair GetMax(int wishl, int wishr, int k, int watchl, int watchr) {
  int mid;
  Pair lval, rval;
  if (wishr <= watchl || watchr <= wishl) return Pair(-0x7fffffffffff, -1);
  if (wishl <= watchl && watchr <= wishr) {
    LazyPropagate(k);
    return seg[k];
  }
  LazyPropagate(k);
  mid = (watchl + watchr) / 2;
  lval = GetMax(wishl, wishr, k * 2 + 1, watchl, mid);
  rval = GetMax(wishl, wishr, k * 2 + 2, mid, watchr);
  return max(lval, rval);
}
int main() {
  scanf("%d%lld%lld", &N, &P, &Q);
  size = 1;
  while (size < N) size *= 2;
  for (int i = 0; i < N; i++) {
    seg[i + size - 1].second = i;
  }
  LLI ans = 0;
  for (int i = 0; i < N; i++) {
    scanf("%lld", &cs[i]);
    LLI t = P * (Q + i) + 2 * P * (N - 1 - i);
    Update(i, i + 1, 0, 0, size, cs[i] - t);
    ans += P * (Q + i);
  }
  while (1) {
    Pair p = GetMax(0, N, 0, 0, size);
    if (p.first < 0) break;
    ans += p.first;
    int k = p.second;
    Update(0, N, 0, 0, size, P * 2);
    Update(k, k + 1, 0, 0, size, -0x7fffffffffff);
  }
  printf("%lld\n", ans);
}
