#include <bits/stdc++.h>
using namespace std;
long long int a[300000];
long long int n, x;
long long int k = 0;
long long int sum = 0;
int main() {
  cin >> n >> x;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sum += a[n] + x;
  k++;
  for (int j = n; j >= 1; j--) {
    sum += pow(k + 1, 2) * (a[j] - a[j - 1]) + x;
    k++;
  }
  cout << sum;
  return 0;
}
