#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

int main(void) {
  ll N, P, Q;
  cin >> N >> P >> Q;
  vector<ll> C(N);
  REP(i, 0, N) cin >> C[i];

  vector<ll> d(N);
  REP(i, 0, N) d[i] = C[i] + P * i;
  sort(d.begin(), d.end(), greater<ll>());

  ll x = Q * P * N + P * N * (N - 1) / 2;
  ll ans = x;
  REP(i, 0, N) {
    x += d[i] - 2 * P * (N - i - 1) - P * Q;
    ans = max(ans, x);
  }
  cout << ans << endl;
}
