SHARE
TWEET

Untitled

a guest Oct 15th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n, b1, q, MAX = map(int, input().split())
  2.  
  3. res = n
  4. for i in range(1, n + 1):
  5.     s = 0
  6.     for j in range(1, i):
  7.         s += b1 * q ** j
  8.     if s <= MAX:
  9.         res = s
  10. print(res)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top