#include <bits/stdc++.h>
using namespace std;
long long a[900000], c[900000], x[900000], n, p, q, i, sum, maxn;
int main() {
  cin >> n >> p >> q;
  c[0] = p * q;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    a[i] -= (q - i) * p;
    sum += a[i];
  }
  sort(a, a + n);
  for (i = 0; i < n; i++) {
    sum -= a[i];
    sum += 2 * i * p;
    maxn = max(sum, maxn);
  }
  cout << maxn << endl;
  return 0;
}
