#include <bits/stdc++.h>
using namespace std;
int N, X;
vector<int> x;
long calc(long dist, long k) { return dist * (k + 1) * (k + 1); }
int main() {
  scanf(" %d %d", &N, &X);
  for (int i = 0; i < N; i++) {
    int tmp;
    scanf(" %d", &tmp);
    x.push_back(tmp);
  }
  long result = 0;
  long k = 0;
  long now = 0;
  for (int i = x.size() - 1; i >= 0; i--) {
    long dist = long(x[i]) - now;
    now = long(x[i]);
    if (dist < 0) {
      dist *= long(-1);
    }
    result += calc(dist, k);
    k++;
    result += long(X);
  }
  result += calc(now, k);
  result += long(X);
  printf("%ld\n", result);
}
