Advertisement
phoenix123565632

C1,C2,C3

Oct 17th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. import math
  2. n,a1,b,mx=map(int,input().split())
  3.  
  4.  
  5.  
  6. if a1<=mx and a1!=0:
  7.     if b!=1:
  8.         osn = (mx * (b - 1)) // a1 + 1
  9.         pp=int(math.log(osn,b))
  10.     else:
  11.         pp=int(mx//a1)
  12.     if pp >= n:
  13.         print(n)
  14.     else:
  15.         print(pp)
  16. else:print(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement