Advertisement
Virtual_Universe

Задача A. Тимбилдинг

Nov 25th, 2015
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. (n,k) = map(int,input().split())
  2. colp = 0
  3. x = n/k
  4.  
  5. def colpar(z):
  6.     return((z*(z-1)/2))
  7.    
  8. if x >= k:
  9.     print(0)
  10. else:
  11.     l = k//x
  12.     c = k%x
  13.     colp+=colpar(l)*(x-c)*x
  14.     colp+=colpar(l+1)*c*x
  15.     print(int(colp))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement