#include <bits/stdc++.h>
using namespace std;

long long n, p, q, sum = 0;
vector<long long> c;

long long solve();

int main() {
  cin >> n >> p >> q;
  c.resize(n);
  for(int i = 0; i < n; ++i) cin >> c[i];
  cout << solve() << endl;
  return 0;
}

long long solve() {
  long long ans = 0;
  for(int i = 0; i < n; ++i) {
    sum += c[i];
    c[i] += p * i;
  }
  sort(c.begin(), c.end());
  for(int i = 1; i < n; ++i) c[i] += c[i - 1];
  ans = sum;
  for(long long i = 0; i < n; ++i) {
    long long now = sum;
    now += p * (q * (i + 1) + i * (i + 1));
    now -= c[i];
    ans = max(ans, now);
  }
  return ans;
}
