import numpy as np

n,X = map(int,input().split())
xs = np.array(list(map(int,input().split())))
cumsumx =np.insert(np.cumsum(xs),0,0)

def energy(k):
    nok = n//k
    acm = (n+k)*X
    for i in range(1,nok+1):
        relsum = cumsumx[-(i-1)*k-1] - cumsumx[-i*k-1]
        if i == 1:
            acm += 5*relsum
        else:
            acm += (2*i+1)*relsum
    relsum = cumsumx[-nok*k-1]
    acm += (2*(nok+1)+1)*relsum
    return(acm)

ans = -1
for j in range (1,n):
    tmp = energy(j)
    if tmp < ans or ans == -1:
        ans =tmp

print(ans)



