Easy25 pts
Chocolate Feast
Bobby has n dollars. Each chocolate costs c. For every m wrappers, exchange for 1 free chocolate. Calculate total chocolates eaten. Example: n=10, c=2, m=5 → Buy 5 chocolates (10/2) → 5 wrappers → Exchange for 1 more → Eat it → 1 wrapper left → Total: 6 chocolates
Input
First line: t (test cases). Next t lines: n c m (space-separated).
Output
For each test case, output the total number of chocolates.
Sample
3 10 2 5 12 4 4 6 2 2
Expected
6 3 5
Loading editor…
Output
No output yet. Run your code to see results.