#include <bits/stdc++.h>
using namespace std;
int N, P, Q;
long long ans, sum = 0;
int C[500000];
vector<pair<int, int> > pairs;
int main() {
  cin >> N >> P >> Q;
  for (int i = 0; i < N; ++i) {
    cin >> C[i];
    sum += C[i];
    pairs.push_back(make_pair(C[i] + P * i, i));
  }
  sort(pairs.begin(), pairs.end());
  for (int i = 0; i < N; ++i) {
    ans = max(ans, sum + P * Q * i + P * i * (i - 1));
    sum -= C[pairs[i].second];
    sum -= P * pairs[i].second;
  }
  cout << ans << endl;
}
