N, K = list(map(int, input().split()))



if K % 2 == 0:

    c1 = 0

    c2 = 0

    for i in range(1, N+1):

        if i % K == K//2:

            c2 += 1

        if i % K == 0:

            c1 += 1

    print((c1**3+c2**3))

else:

    c = 0

    for i in range(1, N+1):

        if i % K == 0:

            c += 1

    print((c**3))

    
N, K = list(map(int, input().split()))

c1 = N // K

if K % 2 == 1:

    print((c1**3))

else:

    c2 = (N+K//2)//K

    print((c1**3+c2**3))
N, K = list(map(int, input().split()))
if K % 2 == 0:
    c1 = 0
    c2 = 0
    for i in range(1, N + 1):
        if i % K == K // 2:
            c2 += 1
        if i % K == 0:
            c1 += 1
    print((c1**3 + c2**3))
else:
    c = 0
    for i in range(1, N + 1):
        if i % K == 0:
            c += 1
    print((c**3))

N, K = list(map(int, input().split()))
c1 = N // K
if K % 2 == 1:
    print((c1**3))
else:
    c2 = (N + K // 2) // K
    print((c1**3 + c2**3))

-if K % 2 == 0: -    c1 = 0 -    c2 = 0 -    for i in range(1, N + 1): -        if i % K == K // 2: -            c2 += 1 -        if i % K == 0: -            c1 += 1 +c1 = N // K +if K % 2 == 1: +    print((c1**3)) +else: +    c2 = (N + K // 2) // K -else: -    c = 0 -    for i in range(1, N + 1): -        if i % K == 0: -            c += 1 -    print((c**3))