#include <bits/stdc++.h>
int main(void) {
  int n, x;
  int i;
  int dust;
  int list[200050];
  long int cost = 0;
  scanf("%d %d\n", &n, &x);
  int po = n;
  for (i = 1; i <= n; i++) {
    if (i == n) {
      scanf("%d", &list[i]);
    } else {
      scanf("%d ", &list[i]);
    }
  }
  while (1) {
    dust = 0;
    if (po == 0) {
      cost += (dust + 1) * (dust + 1) * (list[1] - list[0]);
      break;
    } else if (po == 1) {
      cost += 5 * list[po];
      cost += x;
      break;
    }
    cost += list[po] + 4 * (list[po] - list[po - 1]);
    cost += 2 * x;
    dust += 2;
    po -= 2;
    while (po != 0 && 2 * list[po] < x) {
      cost += x;
      dust += 1;
      cost += (dust + 1) * (dust + 1) * (list[po] - list[po - 1]);
      po -= 1;
    }
    if (po == 0) {
      break;
    }
  }
  cost += (dust + 1) * (dust + 1) * (list[1] - list[po - 1]);
  cost += x;
  printf("%ld", cost);
  return 0;
}
