dxnge

18

Oct 21st, 2021
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. x = int(input())#2
  2. Q = 9; L = 0
  3. if x < Q:
  4.     t = x
  5.     x = Q
  6.     Q = t
  7. while x >= Q:
  8.     L += 1
  9.     x -= Q
  10. M = x
  11. print(L)
  12. print(M)
  13.  
  14. # L_k = 4, 4 повтора
  15. #x - 3*Q >= 9
  16. #    x == 36
  17.  
  18. #x - 4*Q < 9
  19. #    x < 4*9 + 9
  20. #    x < 45
  21.  
  22. #36 - 4*Q == 36 - 4*9 == 0 (4 повтора - x == 0)
  23. #37 (после 4 повторов x == 1, M = x == 1)
  24.  
  25.  
  26. #x = 9; Q = t
  27. #x - 4*Q == 1
  28. #9 - 1 == 4*Q
  29. #Q == 2
  30. #x == 2
Advertisement
Add Comment
Please, Sign In to add comment