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