Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (n,k) = map(int,input().split())
- colp = 0
- x = n/k
- def colpar(z):
- return((z*(z-1)/2))
- if x >= k:
- print(0)
- else:
- l = k//x
- c = k%x
- colp+=colpar(l)*(x-c)*x
- colp+=colpar(l+1)*c*x
- print(int(colp))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement