Joseph Ring algorithm
no vote
A description of Joseph's problem is: 1,2 , n people of N sit around clockwise, each holding a password (positive integer). At the beginning, choose a positive integer as the upper limit value m, start counting from the first person clockwise from 1, and stop counting when M. The person who reports m goes out, takes his password as the new m value, starts from the next person in the clockwise direction, and reports the number from 1 again, so on, until all the people are listed. Try to design a program to find out the order of the column.