#include <bits/stdc++.h>
using namespace std;
struct BIT {
  int d[500005];
  int n;
  void init(int _n) {
    n = _n;
    memset(d, 0, sizeof(d));
  }
  void add(int i, int x) {
    while (i <= n) {
      d[i] += x;
      i += i & -i;
    }
  }
  int sum(int i) {
    int s = 0;
    while (i > 0) {
      s += d[i];
      i -= i & -i;
    }
    return s;
  }
};
long long N, P, Q;
BIT bit;
pair<long long, int> C[100005];
int main() {
  cin >> N >> P >> Q;
  long long sum = 0;
  for (int i = 0; i < N; i++) {
    long long c;
    cin >> c;
    sum += c;
    C[i] = pair<long long, int>((long long)(Q - i) * P - c, i);
  }
  sort(C, C + N);
  bit.init(N);
  long long res = sum;
  for (int i = N - 1; i > -1; i--) {
    long long p = N - 1 - i;
    res = max(res, sum + C[i].first + 2LL * p * P);
    sum = sum + C[i].first + 2LL * p * P;
    bit.add(C[i].second + 1, 1);
  }
  cout << res << endl;
}
