112 - ZOJ Monthly, December 2011 - H
The Cola company is holding a promotional activity that customers can exchange B bottles of Cola with A caps. Now guinao has N caps. Furthermore, guinao can ask mm to borrow him some caps for any times as long as guinao is able to return the caps borrowed after he has used these caps to exchange Cola without buying any other Cola. Please tell guinao how many number of Cola guinao can drink.
This problem contains multiple test cases. Each case contains one line with three numbers N, A, B, (1 <= N <= 10^9, 1 <= B < A <= 10^9), which have already been mentioned above.
Print exactly one line with the maximal number of Cola guinao can drink by exchanging caps for each test case.
1 2 1 9 7 2
Author: YING, Yuanxiang