Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- victums = [int(x) for x in input().split()]
- k = int(input())
- output = []
- idx = k - 1
- while len(victums) > 1:
- output.append(victums.pop(idx))
- idx = (idx + k - 1) % len(victums)
- else:
- output.append(victums[0])
- print(str(output).replace(' ', ''))
Advertisement
Add Comment
Please, Sign In to add comment