#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const unsigned long long D = 8e18 + 18;
long long A[N];
unsigned long long res[N];
int main() {
  long long n, X;
  scanf("%lld%lld", &n, &X);
  for (long long i = 1; i <= n; i++) scanf("%lld", &A[i]);
  A[0] = 0;
  res[n + 1] = 0;
  res[n] = 2 * A[n] + X;
  for (long long i = n; i >= 1; i--) {
    res[i - 1] = D;
    for (long long j = i; j <= n; j++) {
      res[j] += (A[i] * (2 * (j - i + 1) + 1)) + X;
      res[i - 1] = min(res[i - 1], res[j] + 2 * A[i - 1] + X);
    }
  }
  printf("%lld\n", res[0] - X);
}
