Sponsors

Tag: problem: (A) Borya's Diagnosis Solution In C/C++

Codeforces Round #443 (Div....

#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; }

Advertisement

spot_img