#include<bits/stdc++.h>

using namespace std;

typedef long long int64;

int main()
{
  int64 N, P, Q, C[500000] = {};
  scanf("%lld %lld %lld", &N, &P, &Q);
  int64 all = 0;
  for(int i = 0; i < N; i++) {
    int64 A;
    scanf("%lld", &A);
    all += A;
    C[i + 1] = A + P * i;
  }
  sort(C + 1, C + N + 1);
  for(int i = 1; i <= N; i++) C[i] += C[i - 1];
  int64 ret = all;
  for(int i = 0; i <= N; i++) {
    ret = max(ret, all+ P * i * (Q + i - 1) - C[i]);
  }
  printf("%lld\n", ret);
}