#K11911. Days to Empty Water Tank
Days to Empty Water Tank
Days to Empty Water Tank
You are given a water tank with an initial capacity (C), a daily water usage (U), and a daily water refill (R). Each day, the tank loses (U) units of water and gains (R) units. The water tank will eventually become empty if and only if (U > R). In that case, the net water loss per day is (U - R) and the number of days needed to empty the tank is (\lceil \frac{C}{U - R} \rceil). If (U \le R), the tank will never be empty, and you should output (-1).
inputFormat
The input begins with a single integer (T), the number of test cases. Each of the next (T) lines contains three space-separated integers: (C) (the initial capacity), (U) (the daily water usage), and (R) (the daily water refill).
outputFormat
For each test case, output a single line containing the number of days after which the water tank will be empty. If the tank never becomes empty, output (-1).## sample
2
100 10 5
50 20 25
20
-1
</p>