Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def check(g, w, h, n):
- hor = g // w
- ver = g // h
- total = hor * ver
- return total >= n
- w, h, n = map(int,input().split())
- l = 0
- r = max(w, h) * n
- while r - l > 1:
- g = l + (r - l) // 2
- if check(g, w, h, n):
- r = g
- else:
- l = g
- print(r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement