aneliabogeva

Camel's Back

Jun 20th, 2019
104
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. nums = [int(item) for item in input().split(" ")]
  2. n = int(input())
  3. counter = 0
  4.  
  5. k = len(nums)
  6.  
  7. if k == n:
  8. print("already stable:", end=' ')
  9. for i in nums:
  10. print(i, end=" ")
  11. else:
  12. while k > n:
  13. nums.pop(0)
  14. k = len(nums)
  15. if k > n:
  16. nums.pop(-1)
  17. counter += 1
  18. k = len(nums)
  19.  
  20. print(counter, "rounds")
  21. print("remaining:", end=" ")
  22. for i in nums:
  23. print(i, end=" ")
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×