#include <bits/stdc++.h>
using namespace std;
long long n, p, q, ans, tmp;
vector<long long> c, d;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> p >> q;
  c.resize(n);
  for (auto &i : c) cin >> i;
  d.resize(n);
  for (int i = 0; i < n; ++i) {
    d[i] = c[i] + p * (i + 1);
  }
  sort(d.begin(), d.end());
  ans = tmp = accumulate(c.begin(), c.end(), 0);
  for (int i = 0; i < n; ++i) {
    tmp += p * q + (2 * i + 1) * p - d[i];
    ans = max(ans, tmp);
  }
  cout << ans << "\n";
}
