/**
 *    author:  tourist
 *    created: 15.09.2018 15:51:30       
**/
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  long long X;
  cin >> n >> X;
  vector<long long> x(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  vector<long long> s(n + 1);
  s[0] = 0;
  for (int i = 0; i < n; i++) {
    s[i + 1] = s[i] + x[i];
  }
  long long ans = (long long) 9e18;
  for (int k = 1; k <= n; k++) {
    long long cur = 0;
    long long coeff = 3;
    for (int i = n; i > 0; i -= k) {
      cur += (s[i] - s[max(0, i - k)]) * max(coeff, 5LL);
      coeff += 2;
      if (cur >= ans) {
        break;
      }
    }
    cur += (k + n) * X;
    ans = min(ans, cur);
  }
  cout << ans << '\n';
  return 0;
}
