Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Algorithm, must be written in Java code. The program is tested by a website that has several tests (the website gives inputs, which the program
Algorithm, must be written in Java code. The program is tested by a website that has several tests (the website gives inputs, which the program must react to). It needs to contain a scanner of some sort so the website can input letters. All N workes in the factory stand in a circle, where they are are numbered 1 through N. We use the counting threshold C in order to know when to remove a worker from the circle. Counting starts from worker 1, and then we go to worker 2, et cetera. Count until the counter reaches C, and we remove that worker from the circle. Then the counter is reset and starts at 1 at the worker right next to the one who was just removed. This is done until there are only K workers left in the circle, and then the game stops, and those not removed will get a promotion. You and your K-1 friends really want the promotion, but you need to figure out where in the circle you and your friends need to stand in order to not get removed.
Input format
- 1 line with 3 space separated integers: N, C, K, which are respectively the number of workers, the counter threshold, and the number of friends in your job.
Output format
- a space separated list of K integers, indicating the placement of you and your friends in the circle in order for you all to get the promotion. It has to be sorted in increasing order (1-indexed).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started