Advertisement
sazid_iiuc

Untitled

May 12th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int testcase;
  7.    
  8.     cin>>testcase;
  9.  
  10.     while(testcase--)
  11.     {
  12.         int divisor, limit, temp=0;
  13.         cin>>divisor>>limit;
  14.  
  15.         for(int i=1; i<=limit; i++)
  16.         {
  17.             if(i%divisor!=0)
  18.             {
  19.                 temp=i;
  20.             }
  21.             else
  22.             {
  23.                 limit++;
  24.             }
  25.            
  26.         }
  27.         cout<<temp<<endl;
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement