Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- soldiers = list(map(int, input().split()))
- k = int(input())
- executed = []
- position = k - 1
- index = 0
- len_list = (len(soldiers))
- while len_list > 0:
- index = (position + index) % len_list
- current_killed = (soldiers.pop(index))
- len_list -= 1
- executed.append(current_killed)
- print(str(executed).replace(" ", "")
Add Comment
Please, Sign In to add comment