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

using i32 = std::int_fast32_t;
using i64 = std::int_fast64_t;

#define REP(i, stop) FOR(i, 0, stop)
#define FOR(i, start, stop) for (int i = start, i##_len = stop; i < i##_len; ++i)

signed main() {
  i64 n, p, q;
  cin >> n >> p >> q;
  vector<i64> C(n);
  vector<i64> D(n);
  i64 sum = 0;
  REP(i, n) {
    cin >> C[i];
    sum += C[i];
    D[i] = p * (q - i) - C[i];
  }
  sort(D.begin(), D.end(), greater<i64>());
  i64 ans = sum;
  i64 tmp = sum;
  REP(i, n) {
    tmp += D[i] + 2 * p * i;
    ans = max(ans, tmp);
  }
  cout << ans << endl;
}

