ZOJ Problem Set - 3351
Clothes washing is very important in daily life. Of course, washing powder is necessary to make clothes clean. But using washing powder can be a little bit troublesome because after all you have to wash the washing powder away.
So now you are done washing clothes and the only thing left is to wash the washing powder away. Assume that you have t units of water, you are going to divide them into k portions with equal amounts. Then each time add a portion to the washing pool, fully mix them, then wring out the clothes. Repeat the above three steps for k times to make the clothes clean enough. After each time wringing out the clothes, there will be b units of water left on the clothes. Assume there are b units of water on the clothes before what you are going to do and despite water evaporation, your goal is to make washing powder as little as possible.
There will be multiple test cases.
For each case, print the k that makes the washing powder as little as possible. If multiple k exists, print the largest one.
3 1 1
Author: ZHUANG, Junyuan
Contest: ZOJ Monthly, June 2010