#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-9;

//int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;


int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> N >> M >> K;
	vector<long long int>v(N);
	for (auto &i : v)cin >> i;
	vector<long long int>w;
	for (int i = 0; i < N; i++) {
		w.push_back(K*M);
		K--;
	}
	long long int ans = accumulate(v.begin(), v.end(), 0LL);
	long long int add = 0;
	priority_queue<long long int>PQ;
	for (int i = 0; i < N; i++)PQ.push(w[i] - v[i]);
	long long int cadd = 0;
	for (int i = 0; i < N; i++) {
		cadd += M * 2 * i;
		cadd += PQ.top();
		PQ.pop();
		add = max(add, cadd);
	}
	cout << ans + add << endl;
}
