#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  ll n, p, q;
  cin >> n >> p >> q;
  vector<ll> c(n);
  ll sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
    sum += c[i];
    c[i] += i * p;
  }
  sort(c.rbegin(), c.rend());
  vector<ll> s(n + 1);
  for (int i = 0; i < n; i++) s[i + 1] = s[i] + c[i];
  ll ans = sum;
  for (ll i = 1; i <= n; i++) {
    ll temp = (p * q + p * (q + 2 * (i - 1))) * i / 2;
    temp += s[n - i];
    temp -= n * (n - 1) / 2 * p;
    ans = max(ans, temp);
  }
  cout << ans << endl;
  return 0;
}

