#include <algorithm>
#include <iostream>
#include <numeric>
#include <utility>
#include <vector>
using namespace std;

#define llong long long

int main() {
  llong n, p, q;
  cin >> n >> p >> q;
  vector<llong> c(n);
  vector<llong> cp(n);  // cp[i] = c[i]+p*i;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
    cp[i] = c[i] + p * i;
  }

  sort(cp.begin(), cp.end());
  vector<llong> cpr(n + 1, 0);
  for (int i = 1; i <= n; i++) {
    cpr[i] = cpr[i - 1] + cp[i - 1];
  }

  llong sc = accumulate(c.begin(), c.end(), 0LL);

  llong ret = (llong)-1e18;
  for (llong k = 0; k <= n; k++) {
    ret = max(ret, sc - cpr[k] + k * p * (q + k - 1));
  }

  cout << ret << endl;
  return 0;
}
