链接:http://acm.hdu.edu.cn/showproblem.php?pid=1051
思路:一定是奇数,因为到最后肯定是只要花一分钟到达,而前面每一次都是两分钟。
代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;
int main()
{
int n,u,d;
while(cin >> n >> u >> d)
{
if(!n && !u && !d)
break;
int sum=0;
while(n > u)
{
n -= (u-d);
sum++;
}
cout << 2*sum+1<< endl;
}
return 0;
}