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

a, b = 0, 0

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

  if(i%K == 0):

    a += 1

if(K%2 == 0):

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

    if(i%K == K//2):

      b += 1

print((a**3 + b**3))
N, K = list(map(int,input().split()))

k = N//K

ans = k**3

if(K%2 == 0):

  if(K*k+K//2 <= N):

    ans += (k+1)**3

  else:

    ans *= 2

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
if K % 2 == 0:
    for i in range(1, N + 1):
        if i % K == K // 2:
            b += 1
print((a**3 + b**3))

N, K = list(map(int, input().split()))
k = N // K
ans = k**3
if K % 2 == 0:
    if K * k + K // 2 <= N:
        ans += (k + 1) ** 3
    else:
        ans *= 2
print(ans)

-a, b = 0, 0 -for i in range(1, N + 1): -    if i % K == 0: -        a += 1 +k = N // K +ans = k**3 -    for i in range(1, N + 1): -        if i % K == K // 2: -            b += 1 -print((a**3 + b**3)) +    if K * k + K // 2 <= N: +        ans += (k + 1) ** 3 +    else: +        ans *= 2 +print(ans)