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

int main(){
        long long n, p, q, s = 0;
        cin >> n >> p >> q;
        vector<long long> c(n);
        vector<long long> v;
        for(long long i = 0; i < n; i++){
                cin >> c[i];
                s += c[i];
                v.push_back(p * i + c[i]);
        }
        long long ans = s;
        sort(v.begin(), v.end());
        for(long long i = 0; i < n - 1; i++) v[i + 1] += v[i];
        for(long long i = 0; i < n; i++) ans = max(ans, s + (i + 1) * p * q + p * i * (i + 1) - v[i]);
        cout << ans << endl;
        return 0;
}

