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

ans1 = 0

ans2 = 0

ans = 0

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

    if x % k ==0:

        ans1 +=1

if k % 2 == 0:

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

        if y % k == k/2:

            ans2 +=1

print((ans1**3+ans2**3))
from decimal import Decimal, ROUND_HALF_UP

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

ans = 0

if k % 2 ==0:

    p = Decimal(n/k).quantize(Decimal('0'),rounding=ROUND_HALF_UP)

    ans = p**3 +(n//k)**3

else:

    ans = (n // k)**3

print(ans)
n, k = list(map(int, input().split()))
ans1 = 0
ans2 = 0
ans = 0
for x in range(1, n + 1):
    if x % k == 0:
        ans1 += 1
if k % 2 == 0:
    for y in range(1, n + 1):
        if y % k == k / 2:
            ans2 += 1
print((ans1**3 + ans2**3))

from decimal import Decimal, ROUND_HALF_UP

n, k = list(map(int, input().split()))
ans = 0
if k % 2 == 0:
    p = Decimal(n / k).quantize(Decimal("0"), rounding=ROUND_HALF_UP)
    ans = p**3 + (n // k) ** 3
else:
    ans = (n // k) ** 3
print(ans)

+from decimal import Decimal, ROUND_HALF_UP + -ans1 = 0 -ans2 = 0 -for x in range(1, n + 1): -    if x % k == 0: -        ans1 += 1 -    for y in range(1, n + 1): -        if y % k == k / 2: -            ans2 += 1 -print((ans1**3 + ans2**3)) +    p = Decimal(n / k).quantize(Decimal("0"), rounding=ROUND_HALF_UP) +    ans = p**3 + (n // k) ** 3 +else: +    ans = (n // k) ** 3 +print(ans)