#include<bits/stdc++.h>
using namespace std;

using i64 = long long int;

int main(){
    i64 n, p, q;
    cin >> n >> p >> q;

    vector<i64> v;
    i64 sum = 0;
    for(i64 i=1;i<=n;++i){
        i64 c;
        cin >> c;
        v.push_back(p*i + c);
        sum += c;
    }

    sort(v.begin(), v.end());

    i64 ans = sum, acc = 0;
    for(i64 i=0;i<n;++i){
        acc += v[i];
        i64 m = i + 1;
        i64 tmp = sum + m*p*(m+q) - acc;
        ans = max(ans, tmp);
    }

    cout << ans << endl;

    return 0;
}

