fork download
  1. # your code goes here
  2. __author__ = 'hariom'
  3.  
  4. # Enter your code here. Read input from STDIN. Print output to STDOUT
  5. T = int(raw_input())
  6. for i in range (0,T):
  7. A,B,C1 = [int(x) for x in raw_input().split(' ')]
  8.  
  9. answer = 0
  10. wr = 0
  11. # write code to compute answer
  12. while A>0 and A >= B:
  13.  
  14. A -= B ; answer +=1
  15. wr +=1
  16. if wr == C1:
  17. answer +=1
  18. wr = 1
  19.  
  20. print answer
  21.  
Success #stdin #stdout 0.01s 8976KB
stdin
1
43203 60 5
stdout
899