aericktoes

Party Invitation

Feb 4th, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. kNum = int(input())
  2.  
  3. friends = []
  4. friendNum = int(0)
  5.  
  6. while friendNum < kNum:
  7.     friends.append(friendNum + 1)
  8.     friendNum += 1
  9.  
  10. m = int(input())
  11.  
  12. roundCount = 1
  13.  
  14. while roundCount <= m:
  15.     removal = int(input()) - 1
  16.     i = removal
  17.     while removal <= kNum - 1:
  18.         friends.pop(removal)
  19.         removal += i
  20.         kNum -= 1
  21.     roundCount += 1
  22.  
  23. printNum = 0
  24.  
  25. while printNum < kNum:
  26.     print(friends[printNum])
  27.     printNum += 1
Advertisement
Add Comment
Please, Sign In to add comment