function getD(k,d) {
    return Math.pow((k + 1), 2) * d
}

function main(arg) {
    arg = arg.split("\n")
    var x = parseInt(arg[0].split(" ")[1], 10)
    var ai = arg[1].split(" ").map((e) => parseInt(e, 10))
    ai.push(0)
    ai.sort((a,b) => {
        if (a > b) {return -1}
        return 1
    })
    var sum = 0
    var k = 0
    
    
    sum += ai[0]
    for (var i = 1;i < ai.length; i++) {
        var d = ai[i-1] - ai[i]
        k++
        sum += getD(k,d)
    }
    console.log(sum + (k+1)*x)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));