#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000009;
const int INF = INT_MAX / 3;
int main() {
  int n, p, q;
  cin >> n >> p >> q;
  vector<int> c(n);
  for (int i = 0; i < n; i++) cin >> c[i];
  vector<int> weigh(n);
  for (int i = 0; i < n; i++) weigh[i] = c[i] + p * i;
  sort(weigh.begin(), weigh.end());
  long long int csum = 0;
  for (int i = 0; i < n; i++) csum += c[i];
  long long int res = -(1e15);
  long long int oth = 0;
  for (int s = 0; s < n + 1; s++) {
    res = max(q * p * s + csum - oth + s * (s - 1) * p, res);
    if (s < n) oth += weigh[s];
  }
  cout << res << endl;
  return 0;
}
