#include <bits/stdc++.h>
using namespace std;
int c[500010];
int main(void) {
  long long n, p, q;
  cin >> n >> p >> q;
  long long zisui = p * q;
  long long ztotal = 0;
  for (long long i = 0; i < n; i++) {
    long long ccc;
    cin >> ccc;
    c[i] = ccc - zisui;
    ztotal += zisui;
    zisui -= p;
  }
  sort(c, c + n);
  reverse(c, c + n);
  long long max = -9223372036854775808LL;
  long long sum = 0;
  for (long long day = 0; day <= n; day++) {
    if (day != 0) {
      sum += c[day - 1];
    }
    long long zisuiday = n - day;
    long long bonus = p * (zisuiday) * (zisuiday - 1);
    if (zisuiday <= 1) {
      bonus = 0;
    }
    long long ret = sum + bonus + ztotal;
    if (ret > max) {
      max = ret;
    }
  }
  cout << max << endl;
  return 0;
}
