Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n, x, y = map(int, input().split())
- if n == 1:
- print(min(x, y))
- else:
- left = 0
- right = n * (x + y - min(x, y) + 1)
- while left < right - 1:
- center = (left + right) // 2
- if n - 1 <= center // x + center // y:
- right = center
- else:
- left = center
- print(left + min(x, y) + 1)
Add Comment
Please, Sign In to add comment