#include <stdio.h>

int main(void) {
	int n,e,sum,i;
	int x[2001];
	scanf("%d %d",&n,&e);
	for(i=n-1;i>-1;i--){
		scanf("%d",&x[i]);
	}
	x[n]=0;
	sum=sum+x[0];
	for(i=0;i<n;i++){
		sum=sum+e+(x[i+1]-x[i])*(i+1)*(i+1)
	}
	printf("%d",sum);
	return 0;
}
