#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <cmath>
using namespace std;
typedef long long i64;
typedef long double ld;
typedef pair<i64,i64> P;
#define rep(i,s,e) for(int i = (s);i <= (e);i++)

int n;
i64 p;
i64 q;

i64 c[505050];

int main(){
    cin >> n >> p >> q;
    priority_queue<i64,vector<i64>,greater<i64>> que;
    i64 sum = 0;
    rep(i,0,n - 1){
        cin >> c[i];
        sum += c[i];

        que.push(i * p + c[i]);
    }

    i64 result = sum;

    for(int i = 0;!que.empty();i++){
        sum += p * q + 2 * i * p;
        sum -= que.top();
        que.pop();
        result = max(result , sum);
    }

    cout << result << endl;
}

