CSES Problemset/Sorting and Searching
Josephus Problem II
#2163Ask AI
Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.
Open Claude DesktopConsider a game where there are children (numbered ) in a circle. During the game, repeatedly children are skipped and one child is removed from the circle. In which order will the children be removed?
Input
The only input line has two integers and .
Output
Print integers: the removal order.
Constraints
Sample Test Cases (1)
Example 1ID: sample-1
Input
7 2
Expected Output
3 6 2 7 5 1 4
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|1 line, 0 charsTest Bench
Input (stdin)
7 2
Expected Output
3 6 2 7 5 1 4