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

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

    cout << ans << "\n";
    return 0;
}