Vasya has n items lying in a line. The items are consecutively numbered by numbers from 1 to n in such a way that the leftmost item has number 1, the rightmost item has number n. Each item has a weight, the i-th item weights w_{i} kilograms.

Vasya needs to collect all these items, however he won't do it by himself. He uses his brand new robot. The robot has two different arms — the left one and the right one. The robot can consecutively perform the following actions:   Take the leftmost item with the left hand and spend w_{i} · l energy units (w_{i} is a weight of the leftmost item, l is some parameter). If the previous action was the same (left-hand), then the robot spends extra Q_{l} energy units;  Take the rightmost item with the right hand and spend w_{j} · r energy units (w_{j} is a weight of the rightmost item, r is some parameter). If the previous action was the same (right-hand), then the robot spends extra Q_{r} energy units; 

Naturally, Vasya wants to program the robot in a way that the robot spends as little energy as possible. He asked you to solve this problem. Your task is to find the minimum number of energy units robot spends to collect all items.


-----Input-----

The first line contains five integers n, l, r, Q_{l}, Q_{r} (1 ≤ n ≤ 10^5; 1 ≤ l, r ≤ 100; 1 ≤ Q_{l}, Q_{r} ≤ 10^4).

The second line contains n integers w_1, w_2, ..., w_{n} (1 ≤ w_{i} ≤ 100).


-----Output-----

In the single line print a single number — the answer to the problem.


-----Examples-----
Input
3 4 4 19 1
42 3 99

Output
576

Input
4 7 2 3 9
1 2 3 4

Output
34



-----Note-----

Consider the first sample. As l = r, we can take an item in turns: first from the left side, then from the right one and last item from the left. In total the robot spends 4·42 + 4·99 + 4·3 = 576 energy units.

The second sample. The optimal solution is to take one item from the right, then one item from the left and two items from the right. In total the robot spends (2·4) + (7·1) + (2·3) + (2·2 + 9) = 34 energy units.

Difficulty: competition

Starter code:

Solutions:
3

import sys

n, l, r, ql, qr = list(map(int, sys.stdin.readline().strip().split()))
w = [int(x) for x in sys.stdin.readline().strip().split()]

s = [0]
for i in range(0, n):
    s.append(s[-1] + w[i])

def cost(left):
    right = n - left
    diff = left - right
    bonus = 0
    if diff > 0: # left part is larger
        bonus = ql * (diff - 1)
    elif diff < 0: # right part is larger
        bonus = qr * (-diff - 1)
    return bonus + l * s[left] + r * (s[n] - s[left])

best = cost(0)
for left in range(1, n+1):
    c = cost(left)
    if c < best:
        best = c

print(best)


path = list(map(int, input().split()))
n, L, R, QL, QR = path[0], path[1], path[2], path[3], path[4]
w = list(map(int, input().split()))

sumpref = [0]
for i in range(1, n + 1) :
    sumpref.append(w[i - 1] + sumpref[i - 1])

answer = QR * (n - 1) + sumpref[n] * R

for i in range(1, n + 1) :
    energy = L * sumpref[i] + R * (sumpref[n] - sumpref[i])
    if i > (n - i) :
        energy += (i - (n - i) - 1) * QL
    elif (n - i) > i :
        energy += ((n - i) - i - 1) * QR
    if answer > energy:
        answer = energy

print(answer)

n, l, r, ql, qr = map(int, input().split())
w = [0] + list(map(int, input().split()))
for i in range(1, n + 1):
    w[i] += w[i - 1]
s = w[n]
print(min(l * w[i] + r * (s - w[i]) + ql * max(0, 2 * i - n - 1) + qr * max(0, n - 2 * i - 1) for i in range(n + 1)))

n, l, r, Ql, Qr = map(int, input().split())
s, v = [0] * (n + 1), 2 * 10 ** 9
for i, wi in enumerate(map(int, input().split())):
    s[i + 1] = s[i] + wi
for lc in range(0, n + 1):
    rc = n - lc
    c = s[lc] * l + (s[n] - s[lc]) * r
    if lc > rc + 1:
        c += (lc - rc - 1) * Ql
    elif rc > lc + 1:
        c += (rc - lc - 1) * Qr
    v = min(v, c)
print(v)

def main():
    n, l, r, Ql, Qr = list(map(int, input().split()))
    ww = list(map(int, input().split()))
    work = sum(ww) * r + (n - 1) * Qr
    res, penalty = [work], Qr * 2
    l -= r
    for w in ww[:(n - 1) // 2]:
        work += l * w - penalty
        res.append(work)
    penalty = Ql * 2
    work += l * ww[(n - 1) // 2]
    if n & 1:
        res.append(work)
    else:
        work -= Qr
        res.append(work)
        work -= Ql
    for w in ww[(n + 1) // 2:]:
        work += l * w + penalty
        res.append(work)
    print(min(res))


def __starting_point():
    main()

__starting_point()

#print("Allah is the most gracious and the Most Marchiful")

num,l,r,ql,qr,=list(map(int, input().split()))
ara=[int(i) for i in input().split()]
for i  in range(1,num,1):
    ara[i]=ara[i]+ara[i-1]

ans=10**11

for i in range(0,num+1,1):
   tr=num-i
   cl=ara[i-1] if i>0  else 0
   cr=ara[num-1]-cl
   pl=max(0,i-tr-1)
   pr=max(0,tr-i-1)
   tans=pl*ql+pr*qr+cl*l+cr*r
   ans=min(ans,tans)

print(ans)


n, l, r, Ql, Qr = [int(x) for x in input().split(' ')]
w = [int(x) for x in input().split(' ')];
sum = [0 for x in range(n+1)];
for i in range(1, n+1):
	sum[i] = sum[i-1] + w[i-1];
ans = 2**32;
for k in range(0, n+1):
	temp = sum[k]*l + (sum[n] - sum[k])*r;
	if (2*k > n):
		temp += (2*k-n-1)*Ql;
	elif (2*k < n):
		temp += (n-2*k-1)*Qr;
	ans = min(ans, temp);
print(ans);

n, l, r, q1, q2 = list(map(int, input().split()))
item = list(map(int, input().split()))

pre = [item[0]] + [ 0 for i in range(1, n)]
suf = [ 0 for i in range(0, n-1)] + [item[n-1], 0]
for i in range(1, n): pre[i] = pre[i-1] + item[i]
for i in range(n-2, -1, -1): suf[i] = suf[i+1] + item[i]

# print(pre, suf)
ans = 1e20
for i in range(0, n):
    a, b = i+1, n-i-1
    c = pre[i]*l + suf[i+1]*r + (q1*(a-b-1) if a>b else q2*(b-a-1) if b>a else 0)
    # print(c)
    ans = min(ans, c)
ans = min(ans,  suf[0]*r + q2*(n-1))
print(ans)


n, l, r, ql, qr = list(map(int, input().split()))

w = list(map(int, input().split()))

answ = 0
first = 0
last = sum(w)

answ = last * r + (len(w) - 1) * qr

for i in range(n):
    first += w[i]
    last -= w[i]
    tmp = first * l + last * r
    if i + 1 > n - i - 1:
        tmp += ql * (i + 1 - n + i + 1 - 1)
    elif i + 1 < n - i - 1:
        tmp += qr * (n - 2 * i - 3)
    answ = min(answ, tmp)

print(answ)


n, l, r, ql, qr = list(map(int, input().split()))
w = list(map(int, input().split()))
prefix = [0]
suffix = [sum(w)]
for i in range(n):
  prefix.append(prefix[i] + w[i])
  suffix.append(suffix[i] - w[i])

m = 1e10
for i in range(n+1):
  res = l*prefix[i] + r*suffix[i]
  if (i > n - i):
    res += (2*i - n - 1) * ql
  if (i < n - i):
    res += (n - 2*i - 1) * qr
  m = min(m, res)
print(m)
  
  




n, l, r, Ql, Qr = map(int, input().split())
s, v = [0] * (n + 1), 2 * 10 ** 9
for i, wi in enumerate(map(int, input().split())):
    s[i + 1] = s[i] + wi
for lc in range(0, n + 1):
    rc = n - lc
    c = s[lc] * l + (s[n] - s[lc]) * r
    if lc > rc + 1:
        c += (lc - rc - 1) * Ql
    elif rc > lc + 1:
        c += (rc - lc - 1) * Qr
    v = min(v, c)
print(v)

n,l,r,ql,qr = list(map(int,input().split()))
w = list(map(int, input().split()))

s = [0, *w]
for i in range(1, n+1): s[i] += s[i-1]

c_min =  s[n]*r + (n-1)*qr
for i in range(1, n+1):
    cc = l*s[i] + (s[n]- s[i])*r
    if 2*i < n:
        cc += (n-2*i-1)*qr
    elif 2*i > n:
        cc += (i-(n-i) -1)*ql
    c_min = min(c_min, cc)

print(c_min)


n, l, r, ql, qr = map(int, input().split())
w = [0] + list(map(int, input().split()))
for i in range(1, n + 1):
    w[i] += w[i - 1]
s = w[n]
print(min(l * w[i] + r * (s - w[i]) + ql * max(0, 2 * i - n - 1) + qr * max(0, n - 2 * i - 1) for i in range(n + 1)))

n, l, r, ql, qr = map(int, input().split())

w = [0] + list(map(int, input().split()))

for i in range(1, n + 1):

    w[i] += w[i - 1]

s = w[n]

print(min(l * w[i] + r * (s - w[i]) + ql * max(0, 2 * i - n - 1) + qr * max(0, n - 2 * i - 1) for i in range(n + 1)))

n,l,r,ql,qr = map(int,input().split())
w = list(map(int, input().split()))

s = [0, *w]
for i in range(1, n+1): s[i] += s[i-1]

c_min =  s[n]*r + (n-1)*qr
for i in range(1, n+1):
    cc = l*s[i] + (s[n]- s[i])*r
    if 2*i < n:
        cc += (n-2*i-1)*qr
    elif 2*i > n:
        cc += (i-(n-i) -1)*ql
    c_min = min(c_min, cc)

print(c_min)

n, l, r, ql, qr = map(int, input().split())

w = [0] + list(map(int, input().split()))

for i in range(1, n + 1):

    w[i] += w[i - 1]

s = w[n]

print(min(l * w[i] + r * (s - w[i]) + ql * max(0, 2 * i - n - 1) + qr * max(0, n - 2 * i - 1) for i in range(n + 1)))

n, l , r, ql , qr = list(map(int,input().split()))
w = [0] + list(map(int,input().split()))
for i in range (1,n+1):
    w[i] += w[i-1]
s = w[n]
print(min(l*w[i] + r*(s-w[i]) + ql*max(0,2*i-n-1) + qr*max(0,n-2*i-1) for i in range(n+1)))


n, l , r, ql , qr = list(map(int,input().split()))
w = [0] + list(map(int,input().split()))
for i in range (1,n+1):
    w[i] += w[i-1]
s = w[n]
print(min(l*w[i] + r*(s-w[i]) + ql*max(0,2*i-n-1) + qr*max(0,n-2*i-1) for i in range(n+1)))


n, l, r, p, q = list(map(int, input().split()))
arr = list(map(int, input().split()))
res, s, d = int(1<<62), sum(arr), 0
for i in range(n+1):
    if i > 0:
        d += arr[i-1]
    t = d * l + (s - d) * r
    j = n - i
    if i > j:
        t += (i - j - 1) * p
    if i < j:
        t += (j - i - 1) * q
    res = min(res, t)
print(res)


import sys

inf = float("inf")
# sys.setrecursionlimit(10000000)

# abc='abcdefghijklmnopqrstuvwxyz'
# abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
# mod, MOD = 1000000007, 998244353
# words = {1:'one',2:'two',3:'three',4:'four',5:'five',6:'six',7:'seven',8:'eight',9:'nine',10:'ten',11:'eleven',12:'twelve',13:'thirteen',14:'fourteen',15:'quarter',16:'sixteen',17:'seventeen',18:'eighteen',19:'nineteen',20:'twenty',21:'twenty one',22:'twenty two',23:'twenty three',24:'twenty four',25:'twenty five',26:'twenty six',27:'twenty seven',28:'twenty eight',29:'twenty nine',30:'half'}
# vow=['a','e','i','o','u']
# dx,dy=[0,1,0,-1],[1,0,-1,0]

# import random
# from collections import deque, Counter, OrderedDict,defaultdict
# from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
# from math import ceil,floor,log,sqrt,factorial,pi,gcd
# from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right

def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()

n,l,r,ql,qr = get_ints()
Arr = get_array()
pre = [0]*(n+1)
for i in range(1,n+1):
    pre[i] = pre[i-1]+Arr[i-1]
# print(pre)
ans = inf
for i in range(n+1):
    current_cost = pre[i]*l + (pre[n]-pre[i])*r
    if (i>(n-i)):
        current_cost+=(i-n+i-1)*ql
    elif (i<(n-i)):
        current_cost+=(n-i-i-1)*qr
    # print(current_cost)
    ans = min(ans, current_cost)
print(ans)

n,l,r,ql,qr=map(int,input().split())
arr=[int(i) for i in input().split()]
#brute force is the mother of all approaches 
mini=10**20 
sm=sum(arr)
appaji=0
curr=0 
for i in range(n+1):
    if i>0:
       curr+=arr[i-1]
    now=curr*l+(sm-curr)*r   
    j=n-i 
    if i>j: 
        now+=(i-j-1)*ql # appaji 1 
    if j>i:
        now+=(j-i-1)*qr #appaji 2  
    mini=min(mini,now)
print(mini)

n, l, r, ql, qr = list(map(int, input().split()))
w = list(map(int, input().split()))
sum = 0
sums = []
for i in range(n):
    sum += w[i]
    sums.append(sum)

min = r * sum + qr * (n - 1)
for i in range(n):
    ss = l * sums[i] + r * (sum - sums[i])
    if i + 1 > n - i - 1 and i - n + i + 1 > 0:
        ss += ql * (i - n + i + 1)
    elif i + 1 < n - i - 1 and n - i - 2 - i > 1:
        ss += qr * (n - i - 2 - i - 1)
    if ss < min:
        min = ss
print(min)



def solve(lst, l, r, left, right):
    left_sum = [0]
    right_sum = [0] * (len(lst) + 1)

    cum_sum = 0
    for i in range(len(lst)):
        cum_sum += lst[i]
        left_sum.append(cum_sum)

    cum_sum = 0
    for i in reversed(range(len(lst))):
        cum_sum += lst[i]
        right_sum[i] = cum_sum

    #print(lst, left_sum, right_sum)
    min_cost = float('inf')
    for i in range(len(lst)+1):
        cost = left_sum[i] * l + right_sum[i]*r
        #print(i, cost, left_sum[i],l, right_sum[i], r)
        if i > n-i:
            cost += left * (2*i -n -1)
        elif i < n - i:
            cost += right *(n - 1- 2*i)
        #print(cost)
        min_cost = min(min_cost, cost)

    return min_cost

n, l, r, left, right = list(map(int, input().split()))
lst = list(map(int, input().split()))
print(solve(lst, l, r, left, right))

""" My template """
# x0,y0,ax,ay,bx,by = list(map(int,input().split()))
# xs,ys,t = list(map(int,input().split()))
# V = []
# for i in range(61):
#     V.append([x0,y0])
#     x0=ax*x0+bx;y0=ay*y0+by;
# A=0
# for i in range(61):
#     for j in range(i,61):
#         ans=min(abs(xs-V[i][0])+abs(ys-V[i][1]),abs(xs-V[j][0])+abs(ys-V[j][1]))
#         for k in range(i,j):
#             ans=ans+abs(V[k+1][0]-V[k][0])+abs(V[k+1][1]-V[k][1])
#         if ans<=t:
#             A=max(A,j-i+1);
# print(A)

# def f(s):
#     s = str(s)
#     ans = 0
#     for i in s:
#         ans += int(i)
#     return ans

import math
import itertools
n, L, R, Ql, Qr = list(map(int, input().split()))
w = list(map(int, input().split()))
pw = list(itertools.accumulate(w))
ts = sum(w)
ans = math.inf
for i in range(n+1):
    l = i
    r = n - i
    if l > 0:
        lsum = pw[i-1]
    else:
        lsum = 0
    rsum = ts - lsum
    if l < r:
        ans = min(ans, L*lsum + rsum*R + max((r-l-1)*Qr, 0))
    else:
        ans = min(ans, L*lsum + rsum*R + max((l-r-1)*Ql, 0))
print(ans)


n,l,r,ql,qr=list(map(int,input().split()))
li=list(map(int,input().split()))
ri=li.copy()
ri.append(0)
list(map(lambda x:0,ri))
ri[0]=0
ri[1]=li[0]
for i in range(2,len(li)+1):
    ri[i]=ri[i-1]+li[i-1]
minans=1000000000000000
s1=0
for j in range(0,len(li)+1):
    if j<len(li)/2:
        s1=ri[j]*l+ri[len(li)]*r-ri[j]*r+qr*(len(li)-2*j-1)
    elif j>len(li)/2:
        s1=ri[j]*l+ri[len(li)]*r-ri[j]*r+ql*(2*j-len(li)-1)
    else: 
        s1=ri[j]*l+ri[len(li)]*r-ri[j]*r
    # print(s1)
    minans=min([s1,minans])
print(minans)