#include <bits/stdc++.h>
 
using namespace std;
 
int main()
{
    long long n, p, q;
    vector<long long> v;
    
    scanf("%lld %lld %lld", &n, &p, &q);
    
    for (int i = 1; i <= n; i++){
        long long x;
        scanf("%lld", &x);
        v.push_back(x + p * i);
    }
    
    sort(v.rbegin(), v.rend());
    
    long long diff = 0;
    long long s = 0;
    for (int i = 0; i < n; i++){
        s += v[i];
        diff = max(diff, s + (long long)(i + 1) * (i + 1) * p - (long long)(i + 1) * p * (q + 2 * n));
    }
    
    printf("%lld\n", p * (n * q + n * (n - 1) / 2) + diff);
    
    return (0);
}