Number of Days
Submissions: 1041   Accuracy:

16.87%

  Difficulty: Easy   Marks: 2

Find the number of days required to reach the top of the staircase of Q stairs if one moves R stairs upwards during daytime and S stairs downwards during night.

Input:

The input starts with number of test cases, T. Then follows T test cases. Each test case consists of three integers R, S and Q separated by space in a single line.

Output:

For each test case, print the number of days required in a new line.

Constraints:

1<= T <= 100
1 <= S <= R <= Q<= 10^9

Example:

Input:
1
5 1 6

Output:
2

** For More Input/Output Examples Use 'Expected Output' option **

Author: vaibhav2992


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.