#include <bits/stdc++.h>
using namespace std;
const int N = 200200;
long long d[N];
int main() {
  long long n, x;
  cin >> n >> x;
  for (int i = 0; i < n; i++) {
    cin >> d[i];
  }
  long long res = d[n - 1] * 5 + x;
  long long ans = res;
  long long u = 1;
  for (int i = n - 2; i >= 0; i--) {
    if ((x + d[i] * 5) <= ((u + 2) * (u + 2) - (u + 1) * (u + 1)) * d[i]) {
      res += (x + d[i] * 5);
      u = 1;
    } else {
      res += ((u + 2) * (u + 2) - (u + 1) * (u + 1)) * d[i];
      u++;
    }
  }
  res += x * n;
  cout << res;
  return 0;
}
