import           Data.Maybe
import qualified Data.ByteString.Char8         as C8

getInts :: IO [Int]
getInts = fmap (map (fst . fromJust . C8.readInt) . C8.words) C8.getLine

main :: IO ()
main = do
    [n, k] <- getInts
    print
        $ ((n `div` k) ^ 3)
        + ((if even k then (n + k `div` 2) `div` k else 0) ^ 3)
