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