n, k = list(map(int,input().split()))

a, b = 0, 0

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

  if i % k == 0:

    a += 1

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

  if i % k == k // 2:

    b += 1

if k % 2 == 0:

  print((a**3 + b**3))

else:

  print((a**3))

    

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

ans = 0

num = 0



if K % 2 != 0:

    tmp = N // K

    ans = tmp ** 3

else:

    tmp1, tmp2 = 0, 0

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

        if i % K == 0:

            tmp1 += 1

        elif i % (K//2) == 0:

            tmp2 += 1

    ans = tmp1 ** 3 + tmp2 ** 3

print(ans)

n, k = list(map(int, input().split()))
a, b = 0, 0
for i in range(1, n + 1):
    if i % k == 0:
        a += 1
for i in range(1, n + 1):
    if i % k == k // 2:
        b += 1
if k % 2 == 0:
    print((a**3 + b**3))
else:
    print((a**3))

N, K = list(map(int, input().split()))
ans = 0
num = 0
if K % 2 != 0:
    tmp = N // K
    ans = tmp**3
else:
    tmp1, tmp2 = 0, 0
    for i in range(1, N + 1):
        if i % K == 0:
            tmp1 += 1
        elif i % (K // 2) == 0:
            tmp2 += 1
    ans = tmp1**3 + tmp2**3
print(ans)

-n, k = list(map(int, input().split())) -a, b = 0, 0 -for i in range(1, n + 1): -    if i % k == 0: -        a += 1 -for i in range(1, n + 1): -    if i % k == k // 2: -        b += 1 -if k % 2 == 0: -    print((a**3 + b**3)) +N, K = list(map(int, input().split())) +ans = 0 +num = 0 +if K % 2 != 0: +    tmp = N // K +    ans = tmp**3 -    print((a**3)) +    tmp1, tmp2 = 0, 0 +    for i in range(1, N + 1): +        if i % K == 0: +            tmp1 += 1 +        elif i % (K // 2) == 0: +            tmp2 += 1 +    ans = tmp1**3 + tmp2**3 +print(ans)