open Printf open Scanf
module MyInt = struct let (+) = (+) let (-) = (-) let (/) = (/) let ( * ) = ( * ) let (mod) = (mod) let (%) = (mod) let (+=) r v = r := !r + v let (-=) r v = r := !r - v let ( *=) r v= r := !r * v let (/=) r v = r := !r / v end

let () =
	let n,k = scanf " %d %d" (fun u v -> u,v)
	in let q = n/k in
	(
		if k mod 2 = 1 then (
			q*q*q
		) else (
			q*q*q + (
				let v = k/2 in let r = n mod k in
				if r>=v then let qq=q+1 in qq*qq*qq
				else q*q*q
			)
		)
	)
	|> printf "%d\n"