Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- n,a,b,max = map(int,input().split())
- if b == 1:
- otv = int(max//a)
- else:
- otv = int(math.log(max * (b-1)// a+1,b))
- print(min(n,otv))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement