Question: Topic: Data Structure and Algorithm using C language. Q ) These are the ways how the game is played. There are say ' x '

Topic: Data Structure and Algorithm using C language.
Q) These are the ways how the game is played.
There are say 'x' students in the class. Each student is labeled from 1(firststudent) to x
(last student).
A paper is given to n-th student.
The next p-th student who gets the paper quits the game.
The paper is passed until there is one last student who hasn't left the
game. 5. The student becomes the class leader.
Now, your task is to find the number of such students.
Input
The first line contains a number T(0T106).
Each of the next T lines contains 3 integers which are x(0
x) and are separated by a single space.
Output
For each test case, print the required answer.
Examples:
Input:
2
412
523
Output:
2
1
 Topic: Data Structure and Algorithm using C language. Q) These are

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 Databases Questions!