The Almond Problem
Practice
3 (2 votes)
Ad Hoc
Mathematics
Easy
Simple Math
Mathematics
Mathematics
Mathamatics
Problem
94% Success 7386 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code
Initially, there are \(\textbf{K}\) number of almonds in the bowl. Alice eats \(\textbf{A }\) almonds in the morning and \(\textbf{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:
- \(1 \le T \le 5 \)
- \(0 \le A \le 10^9 \)
- \(0 \le B \le 10^9 \)
- \(0 \le K \le 10^9 \)
Submissions
Please login to view your submissions
Similar Problems
Points:20
3 votes
Tags:
ObservationBasic MathAlgorithmsBasics of Greedy AlgorithmsMath
Points:20
1 votes
Tags:
EasyNumber Theory
Points:20
11 votes
Tags:
Ad-HocMathematicsOpenApprovedEasyMathamatics
Editorial