#include <bits/stdc++.h>
using namespace std;
template <typename T>
void chmax(T &a, T b) {
  a = max(a, b);
}
template <typename T>
void chmin(T &a, T b) {
  a = min(a, b);
}
template <typename T>
void chadd(T &a, T b) {
  a = a + b;
}
long long int dx[] = {0, 0, 1, -1};
long long int dy[] = {1, -1, 0, 0};
constexpr long long INF = 1001001001001001001LL;
constexpr long long MOD = 1000000007LL;
long long int N, P, Q;
long long int C[500010], D[500010];
signed main() {
  cin >> N >> P >> Q;
  for (long long int(i) = (0); (i) < (N); (i)++) {
    cin >> C[i];
    D[i] = P * i + C[i];
  }
  sort(D, D + N);
  long long int sum = accumulate(C, C + N, 0), ans = -INF;
  for (long long int(i) = (0); (i) <= (N); (i)++) {
    chmax(ans, sum + P * Q * i + P * i * (i - 1));
    if (i < N) sum -= D[i];
  }
  cout << ans << endl;
  return 0;
}
