#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, p, q, c[500010];
  scanf("%lld%lld%lld", &n, &p, &q);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &c[i]);
  }
  long long a[500010];
  for (int i = 0; i < n; i++) {
    a[i] = c[i] + i * p;
  }
  sort(a, a + n);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    sum += c[i];
  }
  long long ret = sum;
  for (int i = 0; i < n; i++) {
    sum += p * q + 2 * i * p - a[i];
    ret = max(ret, sum);
  }
  cout << ret << endl;
}
