Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. from math import log
  2.  
  3. n_plates, first_loudness, common_ratio, max_loudness = map(int, input().split())
  4.  
  5. if common_ratio == 1: ans = max_loudness // first_loudness
  6. else: ans = int(log(-(max_loudness * (1 - common_ratio) // first_loudness - 1)) / log(common_ratio))
  7.  
  8. if ans >= n_plates: print(n_plates)
  9. elif ans < 0: print('0')
  10. else: print(ans)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement