#include <bits/stdc++.h>
using namespace std;
long long D[1000010], S[1000010];
long long n, X, Ans = 1e18;
signed main() {
  scanf("%lld%lld", &n, &X);
  for (long long i = 1; i <= n; i++)
    scanf("%lld", &D[i]), S[i] = S[i - 1] + D[i];
  for (long long i = 1; i <= n; i++) {
    long long cnt = 0, s = 0, ans = 0, q = 0;
    ans += n * X;
    ans += 2 * (S[n] - S[n - i]);
    ans += i * X;
    for (long long j = n, f = 0; j >= 1; f++, j -= i) {
      long long l = 2 * f + 3;
      if (j > i)
        ans += l * (S[j] - S[j - i] - i * D[j - i]) + q * (D[j] - D[j - i]);
      else
        ans += l * S[j] + q * D[j];
      q += l * i;
      if (ans > 1e18) break;
    }
    if (ans < Ans) Ans = ans;
  }
  printf("%lld\n", Ans);
  return 0;
}
