#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)

void printv(vector<ll> v) {
  for (ll i : v)
    cout << i << endl;
}

int main() {
  ll n, p, q;
  cin >> n >> p >> q;
  vector<ll> l;
  ll sumC = 0;
  rep(i, n) {
    ll c;
    cin >> c;
    sumC += c;
    l.push_back(c - p * (q - i));
  }
  sort(l.begin(), l.end());
  ll ans = sumC;
  ll h = sumC;
  for (ll i = 1; i < n + 1; i++) {
    h = h - l[i-1] + 2 * (i - 1) * p;
    ans = max(ans, h);
  }
  cout << ans << endl;
}

