时间限制:10000ms
单点时限:1000ms
内存限制:256MB
There are N jobs to be finished. It takes a robot 1 hour to finish one job.
At the beginning you have only one robot. Luckily a robot may build more robots identical to itself. It takes a robot Q hours to build another robot.
So what is the minimum number of hours to finish N jobs?
Note two or more robots working on the same job or building the same robot won't accelerate the progress.
The first line contains 2 integers, N and Q.
For 70% of the data, 1 <= N <= 1000000
For 100% of the data, 1 <= N <= 1000000000000, 1 <= Q <= 1000
The minimum number of hours.
<dl></dl>
<dt>样例输入</dt>
<dd></dd>
<dt>样例输出</dt>
首先,如果要复制机器,就要尽早复制,因为尽早复制可以尽早投入生产。
我的纠结点在于,复制的最后一轮,会不会有一部分机器人在复制,其他机器人在工作?
通过严谨的证明说明是不会的。
以下证明过程参考一位大神的,很严谨的证明,I love it!QAQ
因为我上面的证明里得到了“T>2qm”这个临界条件,因此在代码里可以直接使用。详解代码中已给出!