#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <numeric>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <functional>
#include <complex>
#include <stack>
#include <tuple>
#include <array>
using namespace std;
#define rep(i,n) for (int i=0; i < (n); i++)


typedef long long int ll;
typedef double D;      // ??§?¨?????????????double???long double?????????
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;


const int INF = (1<<30) - 1;
const D EPS = 1e-9;

#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)


//g++ -std=c++0x -msse4.2 -O3
//#include <bits/stdc++.h>
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    //cout.precision(16);
    //cout.setf(ios::fixed);
    
    ll N, P, Q; cin >> N >> P >> Q;
    vector<ll> d(N+1);
    for(int i=0; i<N; i++){
        ll c; cin >> c;
        d[i+1] = P * i + c;
    }
    sort(d.rbegin(), d.rend()-1);
    
    for(int i=1; i<=N; i++)
        d[i] += d[i-1];
    
    vector<ll> z(N+1);
    for(int i=1; i<=N; i++)
        z[i] += P*(Q+2*(i-1)) + z[i-1];
    
    ll ans = -1e15;
    for(int i=0; i<=N; i++)
        ans = max(ans, d[i] + z[N-i] - P*N*(N-1)/2);
  
    cout << ans << endl;
    
    return 0;
}