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