Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import log
- n_plates, first_loudness, common_ratio, max_loudness = map(int, input().split())
- if common_ratio == 1: ans = max_loudness // first_loudness
- else: ans = int(log(-(max_loudness * (1 - common_ratio) // first_loudness - 1)) / log(common_ratio))
- if ans >= n_plates: print(n_plates)
- elif ans < 0: print('0')
- else: print(ans)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement