#include <bits/stdc++.h>
using namespace std;
template <typename T>
using vec = std::vector<T>;
const int inf = 1 << 30;
const long long int infll = 1LL << 62;
const double eps = 1e-9;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "[";
  for (const auto &v : vec) {
    os << v << ",";
  }
  os << "]";
  return os;
}
void solve() {
  int n, p, q;
  cin >> n >> p >> q;
  vector<int> c(n);
  int sum = 0;
  vector<int> v;
  for (int i = (0); i < (n); ++i) {
    cin >> c[i];
    sum += c[i];
    v.push_back(-c[i] + p * (q - i));
  }
  sort(v.rbegin(), v.rend());
  int ans = sum;
  for (int i = (0); i < (n); ++i) {
    sum += v[i];
    sum += 2 * p * i;
    ans = max(ans, sum);
  }
  cout << ans << endl;
}
int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  cout.setf(ios::fixed);
  cout.precision(10);
  solve();
  return 0;
}
