dxnge

5

Oct 19th, 2021
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. d = int(input())
  2. n = 8
  3. s = 6
  4. while s <= 1800:
  5.     s = s + d
  6.     n = n + 7
  7. print(n)
  8.  
  9. #n+7k = 258
  10. #k = 34
  11. #(1800-6)/34 == 52.76470588235294
  12. #53 * 33 == 1749, пойдет на 34 повтор и после выйдет из цикла
  13. #54 * 33 == 1782, пойдет на 34 повтор и после выйдет из цикла
  14. #55 * 33 == 1815, выходит из цикла еще на 33 повторе, уже не подходит
  15. #  2 числа
Advertisement
Add Comment
Please, Sign In to add comment