#include <bits/stdc++.h>
using namespace std;
long long N, P, Q;
vector<long long> C;
long long f(long long t) {
  long long res = t * (t - 1) / 2 * 2 * P;
  for (int i = 0; i < N; ++i) {
    res += C[i];
  }
  vector<long long> v;
  for (int i = 0; i < N; ++i) {
    v.push_back((Q - i) * P - C[i]);
  }
  sort(v.begin(), v.end(), greater<long long>());
  for (int i = 0; i < t; ++i) {
    res += v[i];
  }
  return res;
}
int main() {
  cin >> N >> P >> Q;
  C.resize(N);
  for (int i = 0; i < N; ++i) {
    cin >> C[i];
  }
  long long l = 0, r = N;
  for (int t = 0; t < 100; ++t) {
    long long m1 = l + (r - l) / 3, m2 = l + (r - l) * 2 / 3;
    if (f(m1) < f(m2)) {
      l = m1;
    } else {
      r = m2;
    }
  }
  long long ans = l;
  for (long long i = l; i <= r; ++i) {
    if (f(i) > f(ans)) ans = i;
  }
  cout << f(ans) << endl;
}
