Question: Hello, please help me with my data structure assignment using C++ programming language. Please kindly follow the instruction on the question, and do not use

Hello, please help me with my data structure assignment using C++ programming language. Please kindly follow the instruction on the question, and do not use the library bits/stdc++.h, conio.h and limit.h. Thanks a lot!

Hello, please help me with my data structure assignment using C++ programming

Josephus Problem Description n individuals labeled from 1 to n form a circle, which means the next person of the nth person is the first person. Counting begins at the first person, and the mth person counted will go out. Then the counting restart at the next person of the one who went out, and still the mth person counted will go out. Repeat the counting until all of the people have gone out. It's a famous problem and you can seek for some detailed information on wikipedia. In this problem, given n and m, please show the order they went out. Input A single line containing two integers n and m separated by a space. Output Print an, integers in a single line denoting the labels of thlese n persons and indicating the order they went out. Please separate each two of these integers by a single space. Sample Input/Output Input 193 ()utput 36927185184 Constraint 1 5 mm 3 104. Hint 0(nm) algorithm can pass through all test cases

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!