Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- def main():
- n, a1, b, mx = map(int, input().split())
- x = None
- if b > 1:
- exp = (mx * (b - 1)) / a1 + 1
- x = math.ceil(math.log(exp, b))
- if b == 1:
- x = round(mx/a1)+1
- if x > n:
- print(n)
- else:
- print(x-1)
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement