#include <bits/stdc++.h>
using namespace std;
template <class T>
istream& operator>>(istream& is, vector<T>& xs) {
  for (int i = 0; i < xs.size(); i++) is >> xs[i];
  return is;
}
int N, P, Q;
vector<int> C;
vector<long long> A;
int main() {
  cin >> N >> P >> Q;
  C.clear();
  C.resize(N);
  cin >> C;
  sort((C).begin(), (C).end());
  reverse((C).begin(), (C).end());
  A.clear();
  A.resize(N + 1, 0);
  for (int i = 0; i < N; i++) {
    A[i + 1] = A[i] + C[i];
  }
  long long ans = -(1LL << 60);
  for (int m = 0; m <= N; m++) {
    ans = max(ans, P * ((N - m) * Q + N * (N - 1) / 2 - m * N + m) + A[m]);
  }
  cout << ans << endl;
  return 0;
}
