#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
    long long n,p,q;
    cin >> n >> p >> q;
    vector<long long> a(n);
    long long sum = 0;
    for(int i = 0; i < n; i++){
        long long c;
        cin >> c;
        sum += c;
        a[i] = p*i + c;
    }
    sort(a.begin(),a.end());
    for(int i = 0; i < n-1; i++)a[i+1] += a[i];
    long long ans = sum;
    for(int i = 1; i <= n; i++){
        ans = max(ans, sum + i*p*q+p*i*(i-1) - a[i-1]);
    }
    cout << ans << endl;
}

