#include <bits/stdc++.h>
using namespace std;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
const long long INF = (((1 << 30) - 1) << 1) + 1;
const long long nINF = 1 << 31;
const long long N = 2e5 + 10;
long long n, x, a[N], s[N];
long long rangesum(long long l, long long r) {
  return s[r] - (l > 0 ? s[l - 1] : 0);
}
signed main() {
  ios::sync_with_stdio(false);
  cin >> n >> x;
  for (long long i = 0; i < (n); i++) cin >> a[i];
  s[0] = a[0];
  for (long long i = (1); i <= (n - 1); i++) s[i] = s[i - 1] + a[i];
  long long ans = numeric_limits<long long>::max();
  for (long long trips = (1); trips <= ((n + 1) / 2); trips++) {
    long long m = 5;
    long long cur = m * rangesum(n - 2 * trips, n - 1);
    long long idx = n - 2 * trips;
    while (idx > 0) {
      m += 2;
      cur += m * rangesum(idx - trips, idx - 1);
      idx = idx - trips;
    }
    cur += (n + trips) * x;
    if (cur > 0) ans = min(ans, cur);
  }
  cout << ans << endl;
  return 0;
}
