dxnge

tsk 5

Nov 3rd, 2021 (edited)
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. cnt = 0
  2. for i in range(1000):
  3.     n = 1
  4.     s = i
  5.     while s > n:
  6.         s -= 15
  7.         n *= 5
  8.     if n == 125:
  9.         cnt += 1
  10. print(cnt)
  11. # x > 1
  12. # x - 15 > 5
  13. #x - 15 - 15 > 25
  14. #x - 15 - 15 - 15 <= 125
  15. #min x == 25 + 1 + 15 + 15 == 56
  16. #max x == 125 + 15*3 == 170
  17. #cnt == 170 - 56 + 1 == 115
Advertisement
Add Comment
Please, Sign In to add comment