Answered step by step
Verified Expert Solution
Link Copied!

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).

image text in transcribed

Examples Input 1 11 23 Output 1 37 11

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Murach's SQL Server 2012 For Developers

Authors: Bryan Syverson, Joel Murach, Mike Murach

1st Edition

1890774693, 9781890774691

More Books

Students also viewed these Databases questions

Question

Are these written ground rules?

Answered: 1 week ago

Question

How do members envision the ideal team?

Answered: 1 week ago

Question

Has the team been empowered to prioritize the issues?

Answered: 1 week ago