Little Bob loves chocolate, and he goes to a store with $N in his pocket. The price of each chocolate is $C. The store offers a discount: for every M wrappers he gives to the store, he gets one chocolate for free. How many chocolates does Bob get to eat?
The first line contains the number of test cases, T.
T lines follow, each of which contains three integers, N, C, and M.
Print the total number of chocolates Bob eats.
3 10 2 5 12 4 4 6 2 2
static void Main(String args)
int cases = int.Parse(Console.ReadLine());
for (int i = 0; i < cases; i++)
int temp = Console.ReadLine().Split(‘ ‘).Select(x => int.Parse(x)).ToArray<int>();
int total = temp / temp;
int wrappers = total;
while (wrappers >= temp)
int temp2 = wrappers / temp;
total += temp2;
wrappers = (wrappers – (temp2 * temp)) + temp2;