#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;

ll N, P, Q;
ll C[500000];
ll d[500000];

int main() {
  scanf("%lld%lld%lld", &N, &P, &Q);
  ll init = 0;
  for (ll i = 0; i < N; i++) {
    scanf("%lld", &C[i]);
    d[i] = i * P + C[i];
    init += C[i];
  }
  sort(d, d + N);
  ll sum = init, ans = init;
  for (ll i = 0; i < N; i++) {
    sum += 2 * P * i + P * Q - d[i];
    ans = max(ans, sum);
  }
  printf("%lld\n", ans);
}

