显示代码纯文本
#include<cstdio>
#include<iostream>
using namespace std;
inline int get();
int c,va,vb,a,p;
int ans,temp;
int main()
{
freopen("MrBA.in","r",stdin);
freopen("MrBA.out","w",stdout);
c=get(),va=get(),vb=get(),a=get(),p=get();
temp+=va;ans++;
while(temp<c)
{
va+=a;
if(va>vb)va=vb;
temp+=(va-p);ans++;
}
printf("%d",ans);
return 0;
}
inline int get()
{
int t=0;char c=getchar(),j=1;
while(!isdigit(c))
{
if(c=='-')j=-1;
c=getchar();
}
while(isdigit(c))
{
t=(t<<3)+(t<<1)+c-'0';
c=getchar();
}
return j*t;
}