import sys

input = sys.stdin.readline





def main():

    N, K = [int(x) for x in input().split()]

    ans = 0

    if K & 1:

        print(((N // K) ** 3))

    else:

        ans += (N // K) ** 3

        ans += ((N + K // 2) // K) ** 3

        print(ans)







if __name__ == '__main__':

    main()



N, K = [int(x) for x in input().split()]



ans = 0



ans += (N // K) ** 3



if K % 2 == 0:

    ans += ((N - K // 2) // K + 1) ** 3





print(ans)





import sys

input = sys.stdin.readline


def main():
    N, K = [int(x) for x in input().split()]
    ans = 0
    if K & 1:
        print(((N // K) ** 3))
    else:
        ans += (N // K) ** 3
        ans += ((N + K // 2) // K) ** 3
        print(ans)


if __name__ == "__main__":
    main()

N, K = [int(x) for x in input().split()]
ans = 0
ans += (N // K) ** 3
if K % 2 == 0:
    ans += ((N - K // 2) // K + 1) ** 3
print(ans)

-import sys - -input = sys.stdin.readline - - -def main(): -    N, K = [int(x) for x in input().split()] -    ans = 0 -    if K & 1: -        print(((N // K) ** 3)) -    else: -        ans += (N // K) ** 3 -        ans += ((N + K // 2) // K) ** 3 -        print(ans) - - -if __name__ == "__main__": -    main() +N, K = [int(x) for x in input().split()] +ans = 0 +ans += (N // K) ** 3 +if K % 2 == 0: +    ans += ((N - K // 2) // K + 1) ** 3 +print(ans)