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

About the Author:

Leave A Comment