Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question 84 #197

Open
JMukta25 opened this issue Oct 28, 2022 · 6 comments
Open

Question 84 #197

JMukta25 opened this issue Oct 28, 2022 · 6 comments
Assignees

Comments

@JMukta25
Copy link
Collaborator

A jail has a number of prisoners and a number of treats to pass out to them. Their jailer decides the fairest way to divide the treats is to seat the prisoners around a circular table in sequentially numbered chairs. A chair number will be drawn from a hat. Beginning with the prisoner in that chair, one candy will be handed to each prisoner sequentially around the table until all have been distributed.

The jailer is playing a little joke, though. The last piece of candy looks like all the others, but it tastes awful. Determine the chair number occupied by the prisoner who will receive that candy.
n=4
m=6
s=2
There are 4 prisoners, 6 pieces of candy and distribution starts at chair 2 . The prisoners arrange themselves in seats numbered 1 to 4 . Prisoners receive candy at positions 2,3,4,1,2,3 . The prisoner to be warned sits in chair number .
Input Format
int n: the number of prisoners
int m: the number of sweets
int s: the chair number to begin passing out sweets from
Input 1
2
5 2 1
5 2 2
Output
2
3
Input 2
2
7 19 2
Output
6
3
3 7 3

@aditi3004
Copy link
Contributor

HEY!!!
This is Aditi Sharma(SY-C)
MKSSS's CCOEW
Computer Engineering

I want to work on this issue
Please assign this to me.

@NikitaMiraje
Copy link
Contributor

Nikita Miraje
CCOEW E&TC
I would like to work on this issue.....can you plz assign this issue to me????

@Git-Akshat01
Copy link

Hi! @JMukta25 Can you please assign me this task.
I am Akshat Tiwari of BIT Raipur from Computer Science Engineering Branch.

@JMukta25
Copy link
Collaborator Author

Hi! @JMukta25 Can you please assign me this task. I am Akshat Tiwari of BIT Raipur from Computer Science Engineering Branch.

How many issues have been assigned to you yet?

@Git-Akshat01
Copy link

Only 1

@JMukta25
Copy link
Collaborator Author

Only 1

I have assigned this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants