https://i2.wp.com/eblogarithm.com/wp-content/uploads/2017/11/Codeforces-Round-443-Div-2-problem-A-Boryas-Diagnosis-Solution-In-CC1.png?fit=640%2C360

Codeforces Round #443 (Div. 2), problem: (A) Borya’s Diagnosis Solution In C/C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i,s,d,t=0;
cin>>n;
for(i=0;i<n;i++)
{
cin>>s>>d;
while(s<=t)
{
s=s+d;
}
t=s;
}
cout<<s<<endl;
}

(Visited 13 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: