#include <bits/stdc++.h>
using namespace std;
long long n, p, q;
long long c[500000];
long long rc[500001];
signed main() {
  long long i;
  cin >> n >> p >> q;
  for (i = 0; i < n; i++) {
    cin >> c[i];
    c[i] += i * p;
  }
  sort(c, c + n);
  for (i = 1; i <= n; i++) {
    rc[i] = rc[i - 1] + c[i - 1];
  }
  long long ans = -1e+18;
  for (i = 0; i <= n; i++) {
    long long jisui = i * q + 2 * p * i * (i - 1) / 2;
    long long syoku = rc[n] - rc[i];
    ans = max(ans, jisui + syoku);
  }
  ans -= p * n * (n - 1) / 2;
  cout << ans << endl;
  return 0;
}
