import sys
def solve():
    readline = sys.stdin.readline
    write = sys.stdout.write
    N, P, Q = map(int, readline().split())
    *C, = [int(readline()) for i in range(N)]
    A = [0]*N
    su = sum(C)
    for i in range(N):
        A[i] = P*(Q-i) - C[i]
    A.sort(reverse=1)
    ans = su
    for i in range(N):
        su += A[i]
        ans = max(ans, su + P*i*(i+1))
    write("%d\n" % ans)
solve()
