#include<bits/stdc++.h>
using namespace std;
using Int = long long;
signed main(){
  Int n,p,q;
  cin>>n>>p>>q;
  vector<Int> c(n);
  for(Int i=0;i<n;i++) cin>>c[i];
  vector<Int> v(n);
  for(Int i=0;i<n;i++)
    v[i]=(q-i)*p-c[i];
  
  sort(v.rbegin(),v.rend());
  Int tmp=accumulate(c.begin(),c.end(),Int(0));
  Int ans=tmp;
  for(Int i=0;i<n;i++){
    tmp+=v[i];
    ans=max(ans,tmp+i*(i+1)*p);
    //cout<<i+1<<":"<<tmp<<":"<<i*(i+1)*p<<endl;
  }
  
  cout<<ans<<endl;
  return 0;
}