Order of Elimination
N people stand in a circle; counting from position 1, every K-th person is removed. Print the FULL elimination order.
Input: one line with two integers N and K.
Output: the N eliminated positions in order.
Constraints:
- 1 ≤ N, K ≤ 3000
Sample Tests
Input 1
7 3
Output 1
3 6 2 7 5 1 4
Input 2
1 5
Output 2
1
Discussion (opens after you solve — no spoilers before)
No comments yet.