#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 500005;
int main() {
  int n, p, q;
  long long a[MAX_N];
  scanf("%d%d%d", &n, &p, &q);
  for (int i = 0; i < (int)n; ++i) {
    scanf("%lld", &a[i]);
    a[i] += (long long)(i - 1) * p;
  }
  sort(a, a + n);
  long long ch = 0;
  long long lh = 0;
  long long mx = 0;
  for (int k = 0; k < (int)n; ++k) {
    lh += a[k];
    ch += (long long)p * (q + 2 * k);
    if (ch - lh > mx) {
      mx = ch - lh;
    }
  }
  long long sub = 0;
  for (int i = 0; i < (int)n - 1; ++i) {
    sub += (long long)(i + 1) * p;
  }
  printf("%lld\n", accumulate(a, a + n, 0LL) + mx - sub);
  return 0;
}
