#include <bits/stdc++.h>
using namespace std;
long long n, p, Q;
long long calc(long long a, long long l, long long n) {
  return (a + l) * n / 2;
}
int main() {
  cin >> n >> p >> Q;
  vector<long long> V;
  for (int i = 0; i < n; i++) {
    long long C;
    cin >> C;
    V.push_back(C - p * (Q + i) - 2 * p * (n - i - 1));
  }
  sort(V.begin(), V.end(), greater<long long>());
  long long sum = p * calc(Q, Q + n - 1, n);
  long long ans = sum;
  for (int i = 0; i < n; i++) {
    sum += V[i];
    ans = max(ans, sum);
  }
  cout << ans << endl;
  return 0;
}
