#include <bits/stdc++.h>
using namespace std;
const long long inf = (1ll << 60);
const double eps = 1e-10;
const double pi = acos(-1.0);
inline long long read() {
  long long x = 0, f = 1;
  char ch;
  ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = 0;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch & 15);
    ch = getchar();
  }
  if (f)
    return x;
  else
    return -x;
}
const int N = 2010;
long long n, x, ans = inf;
long long id[N], f[N][N];
int main() {
  n = read();
  x = read();
  for (int i = 0; i < n; i++) id[i] = read();
  memset(f, 127, sizeof(f));
  f[n][0] = 0;
  for (int i = n - 1; i >= 0; i--)
    for (int j = 1; j <= n; j++) {
      long long v = n - i - j - 1;
      if (v >= 0)
        f[i][j] = min(f[i][j], f[i + 1][j] + x + id[i] * ((v / j) * 2 + 5));
      f[i][j] = min(f[i][j], f[i + 1][j - 1] + x * 2 + id[i] * 5);
    }
  for (int j = 1; j <= n; j++) ans = min(ans, f[0][j]);
  printf("%lld\n", ans);
  return 0;
}
