https://i2.wp.com/eblogarithm.com/wp-content/uploads/2017/08/Codeforces-Round-421-Div-2-problem-A-Mister-B-and-Book-Reading-Solution-In-CC1.png?fit=640%2C360

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 39 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: