#include <bits/stdc++.h>
using namespace std;
long long n, p, q, c[500005], x[500005], cnt, ans;
int main() {
  cin >> n >> p >> q;
  for (int i = 0; i < n; i++) cin >> c[i];
  for (int i = 0; i < n; i++) x[i] = p * q, q++;
  for (int i = n - 1; i >= 0; i--) {
    ans += x[i];
    long long cal = ans + c[i] - x[i] * p - 2 * p * cnt;
    if (ans < cal)
      ans = cal;
    else
      cnt++;
  }
  cout << ans << endl;
  return 0;
}
