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

By |2017-11-08T09:19:12+00:00November 8th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , |

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