Chocolate Feast : HackerRank Problem Solution

A Boy has $N money. Price of each chocolate is $C. For every M wrappers the boy gives to shop keeper, he gets one chocolate back. Find the total number of chocolates the boy has ?
Input:# number of test cases
3                
# N, the total money & C, cost of each chocolate & M, For M  wrappers, one chocolate is given back.  
10 2 5  
      
12 4 4

6 2 2

Output:

6

3

5

PHP Implementation: