#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
int n,p,q,c[500005];
priority_queue<pair<ll,int> >que;
struct BIT
{
	int bit[(1<<20)+5];
	int f(int x)
	{
		return x&-x;
	}
	void add(int i,int x)
	{
		for(int s=i;s<=(1<<20);s+=f(s)) bit[s]+=x;
	}
	int sum(int i)
	{
		int res=0;
		for(int s=i;s>0;s-=f(s)) res+=bit[s];
		return res;
	}
}bit;
int main(){
	scanf("%d%d%d",&n,&p,&q);
	for(int i=1;i<=n;i++) scanf("%d",&c[i]);
	for(int i=1;i<=n;i++){
		que.push(mp(1LL*i*p+c[i],i));
	}
	ll ret = 0,cur,Q = q;
	for(int i=1;i<=n;i++){
		ret += 1LL*Q*p; Q++;
	}
	cur = ret;
	int cnt = 0;
	while(!que.empty()){
		int id = que.top().sc; que.pop();
		cur += c[id];
		cur -= 1LL*(q+id-1-2*bit.sum(id-1))*p;
		cur -= (n-id-cnt+bit.sum(id-1))*2*p;
		ret = max(ret,cur);
		bit.add(id,1); cnt++;
	}
	cout << ret << endl;
}