Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tests = input()
- output = []
- for i in xrange(tests):
- inputs = raw_input()
- inputs = inputs.split()
- for i,n in enumerate(inputs):
- inputs[i] = int(n)
- N, C, M = inputs
- choc = wrap = N/C
- while wrap >= M:
- choc += wrap/M
- wrap = wrap/M + wrap%M
- output.append(choc)
- for o in output:
- print o
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement