mirror of
https://github.com/codeflash-ai/codeflash-internal.git
synced 2026-05-04 18:25:18 +00:00
18 lines
251 B
Python
18 lines
251 B
Python
def problem_p03268(input_data):
|
|
N, K = list(map(int, input_data.split()))
|
|
|
|
if K % 2 == 1:
|
|
|
|
n = N // K
|
|
|
|
ans = n**3
|
|
|
|
else:
|
|
|
|
n1 = N // K
|
|
|
|
n2 = 1 + (N - K // 2) // K
|
|
|
|
ans = n1**3 + n2**3
|
|
|
|
return ans
|