Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n, m, k = map(int, input().split())
- if m < 2 or k < 2:
- print(0)
- else:
- if n % (k-2) != 0 and m//(n/(k-2)+1) >= 2:
- print(n//(k-2)+1)
- elif n % (k-2) == 0 and m - 2 * n // (k - 2) > 0:
- print(n // (k-2) + (m - 2 * n // (k - 2)) // (n // (k-2) + 1))
- elif n % (k-2) == 0 and m//(n//(k-2)) >=2:
- print(n//(k-2))
- else:
- print(0)
Advertisement
Add Comment
Please, Sign In to add comment