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