总长n,每秒走u,下降d
因为要下降 相当与每两秒走 u-d
计算n-u 要走的时间
最后加1就行了
#include<stdio.h>
#include
using namespace std;
int main()
{
int n, u, d;
while (cin>>n>>u>>d)
{
int t = (n - u) / (u - d);
if (t*(u - d) < (n - u)) t++;
t *= 2;
t++;
cout << t;
}
//return 0;
system(“pause”);
}