The Almond Problem

3

2 votes
Ad-Hoc, Mathematics, Easy, Simple-math, Mathematics, Mathematics, Mathamatics
Problem

Initially, there are K number of almonds in the bowl. Alice eats almonds in the morning and B number of almonds is added to her bowl in the evening. You need to determine the number of consecutive days for which Alice will be able to eat almonds.

Input Format:
The first line of the input contains an integer T,the number of test cases.
Each test case is described by 3 lines,having the integers A, B and K respectively.

Output Format:

Output the answer for each test case in a new line.
If the activity can go on forever,print -1.

Input Constraints:

  • 1T5
  • 0A109
  • 0B109
  • 0K109
Sample Input
1
2
1
2
Sample Output
1
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

In the sample case, there are initially 2 almonds in the bowl.On the first day, Alice eats 2 almonds and later in the evening, 1 almond is added into the bowl.The next morning, there will be only 1 almond in the bowl. So, the answer is 1 day.

Editor Image

?