
fun main(arr:Array<String>) {
    val (a,b) = readLine()!!.split(" ").map { it.toInt() }
    val tmp1 = a/b
    var tmp2 = 0
    if(b % 2 == 0) {
        tmp2 = tmp1
        if(a%b >= b/2) {
            tmp2++
        }
    }
    val ans = Math.pow(tmp1.toDouble(), 3.0) + Math.pow(tmp2.toDouble(), 3.0)
    println(ans.toLong())
}
