dxnge

Task 14

Sep 18th, 2021
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. n, m, k = map(int, input().split())
  2. if m < 2 or k < 2:
  3.     print(0)
  4. else:
  5.     if n % (k-2) != 0 and m//(n/(k-2)+1) >= 2:
  6.         print(n//(k-2)+1)
  7.     elif n % (k-2) == 0 and m - 2 * n // (k - 2) > 0:
  8.         print(n // (k-2) + (m - 2 * n // (k - 2)) // (n // (k-2) + 1))
  9.     elif n % (k-2) == 0 and m//(n//(k-2)) >=2:
  10.         print(n//(k-2))
  11.     else:
  12.         print(0)
Advertisement
Add Comment
Please, Sign In to add comment