function gets(str){
  this._s = str.split("\n");
  this._y = 0;
};
gets.prototype = {
  a: function(f){
    var s = this._s, y = this._y, r;
    if(typeof s[y] === "string")s[y] = s[y].split(" ").reverse();
    r = s[y].pop();
    if(!s[y].length)this._y++;
    return f?r:+r;
  },
  l: function(f){
    var s = this._s[this._y++].split(" ");
    return f?s:s.map(a=>+a);
  },
  m: function(n,f){
    var s = this._s, y = this._y, r = [], i = 0;
    if(f)for(;i < n; i++)r[i] = s[y+i].split(" ");
    else for(;i < n; i++)r[i] = s[y+i].split(" ").map(a=>+a);
    this._y += n;
    return r;
  },
};
var o=new gets(require("fs").readFileSync("/dev/stdin","utf8"));

console.log(main());
function main(){
  var n = o.a();
  var x = o.a();
  var a = o.l();
  var ans = n * x;
  for(var i = n-1; i >= 0; i--){
    var u = 2, b = 0;
    ans += a[i];
    while(i > 0){
      var y = x + a[i-1] * (u*u+5);
      var z = a[i-1] * (u+1) * (u+1);
      if(y >= z){
        ans += (a[i] - a[i-1]) * u * u;
        u++;
        i--;
      }else{
        ans += x + a[i] * u * u;
        break;
      }
    }
    if(i === 0){
      ans += x + a[0] * u * u;
    }
  }
  return ans;
}