#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, q, p;
  cin >> n >> p >> q;
  vector<long long> v;
  long long sum = 0;
  for (long long(i) = (0); (i) < (n); ++i) {
    long long c;
    cin >> c;
    sum += c;
    v.push_back(-c + (q - i) * p);
  }
  long long ans = sum;
  for (long long(i) = (0); (i) < (n); ++i) {
    sum += v[i];
    ans = max(ans, sum + i * (i + 1) * p);
  }
  cout << ans << endl;
  return 0;
}
