Physics Homework
InterviewTime limit1sMemory limit256 MB
For each test case, find the time at which car A, starting slower than car B and accelerating, reaches or passes car B's constant speed.
- Level
Easy2 of 10
- Topics
- Math, Implementation, Simulation, Brute force
- Solved
- No attempts yet
Problem
Sihyeon, a first-year student in the Department of Computer Engineering at Jeonbuk National University, is taking Basic Physics, a required general education course for engineering students.
Sihyeon studies hard, and while working through a physics workbook, came across the following problem.

Sihyeon usually likes physics and figured out parts (a) and (b) right away, but could not solve part (c) and is in despair.
Let us help Sihyeon out of that despair.
Input
The first line gives the number of test cases T. (1 ≤ T ≤ 100)
From the next line on, each test case gives the speeds X and Y of car A and car B, and the acceleration Z of car A. The values in each input are separated by spaces.
Here, 0 ≤ X < Y ≤ 10,000 and 0 < Z ≤ 10,000.
Output
For each test case, print the time in seconds at which the speed of car A becomes equal to or greater than the speed of car B.