#include <bits/stdc++.h>
using namespace std;
int n, p, q;
int c[500000];
int main() {
  scanf("%d %d %d", &n, &p, &q);
  for (int i = 0; i < n; i++) {
    scanf("%d", c + i);
  }
  int add = 0;
  for (int i = 0; i < n; i++) {
    c[i] += i * p;
    add += i * p;
  }
  sort(c, c + n);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    sum += c[i];
  }
  long long res = sum;
  for (int i = 0; i < n; i++) {
    sum -= c[i];
    sum += (long long)(q + i * 2) * p;
    res = max(res, sum);
  }
  printf("%lld\n", res - add);
  return 0;
}
