#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
long long a[200500];
long long d[200500];
long long n, x;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> x;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    d[i] = d[i - 1] + a[i];
  }
  long long ans = 1e18;
  for (int k = 1; k <= n; ++k) {
    long long res = 0;
    int r = (int)n;
    long long e = 1;
    while (r) {
      int l = max(0, r - k);
      if (e == 1) {
        res += 5 * (d[r] - d[l]);
      } else {
        res += (2ll * e + 1) * (d[r] - d[l]);
      }
      r = l;
      e++;
    }
    ans = min(res + k * x, ans);
  }
  cout << ans + n * x;
  return 0;
}
