#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, p, q, c;
  scanf("%lld%lld%lld", &n, &p, &q);
  vector<long long> x(n);
  for (int i = 0; i < (int)(n); i++) {
    scanf("%lld", &c);
    x[i] = c - (q + i) * p - (n - 1 - i) * 2 * p;
  }
  sort(x.begin(), x.end());
  long long res = p * (n * q + n * (n - 1) / 2), sum = res;
  for (int i = 0; i < (int)(n); i++) {
    sum += x[n - 1 - i];
    res = max(res, sum + p * i * (i + 1));
  }
  printf("%lld\n", res);
}
