Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import deque
- names = deque(input().split(' '))
- toss = int(input())
- idx = 0
- while names:
- idx += 1
- person = names.popleft()
- if idx % toss == 0:
- if names:
- print(f'Removed {person}')
- else:
- print(f'Last is {person}')
- else:
- names.append(person)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement