Codeforces Round #421 (Div. 2), problem: (A) Mister B and Book Reading Solution In C/C++

#include <iostream>
using namespace std;
int c,v,vl,l,a;
int main(){
cin>>c>>v>>vl>>a>>l;
int s=1;
for(int i=v;i<c;){
v+=a;
if(v>vl) v=vl;
i-=l;
i+=v;
s++;}
cout<<s<<endl;
}

(Visited 76 times, 1 visits today)

About the Author:

Leave A Comment