n, x, y = map(int, input().split()) A = list(map(int, input().split())) s = sum(A) from itertools import accumulate INF = 10**18 C = [0]+A C = list(accumulate(C)) L = [-INF] import heapq q = [] heapq.heapify(q) heapq.heappush(q, x*0-C[0]) for i in range(1, n+1): temp = (x*i-C[i])-q[0] L.append(temp) heapq.heappush(q, x*i-C[i]) #print(L) R = [-INF] q = [] heapq.heapify(q) heapq.heappush(q, -(y*n-C[n])) for i in reversed(range(n)): temp = -q[0]-(y*i-C[i]) R.append(temp) heapq.heappush(q, -(y*i-C[i])) R.reverse() #print(R) for i in range(1, n+1): L[i] = max(L[i-1], L[i]) for i in range(n-1, -1, -1): R[i] = max(R[i+1], R[i]) #print(L) #print(R) for i in range(2, n): ans = s+L[i-1]+R[i] print(ans)