CSES Problemset/Sorting and Searching
Josephus Problem I
#2162Ask 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, every other child is removed from the circle until there are no children left. In which order will the children be removed?
Input
The only input line has an integer .
Output
Print integers: the removal order.
Constraints
Sample Test Cases (1)
Example 1ID: sample-1
Input
7
Expected Output
2 4 6 1 5 3 7
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|1 line, 0 charsTest Bench
Input (stdin)
7
Expected Output
2 4 6 1 5 3 7