#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, P, Q;
  cin >> N >> P >> Q;
  priority_queue<int> que;
  int sum = 0;
  for (int i = 0; i < N; i++) {
    int C;
    cin >> C;
    sum += C;
    que.push(P * (Q - i) - C);
  }
  int ans = sum;
  for (int D = 0; D < N; D++) {
    int t = que.top();
    que.pop();
    sum += t + D * 2 * P;
    ans = max(ans, sum);
  }
  cout << ans << endl;
  return 0;
}
