Source Code
#include <iostream>
#include <bits/stdc++.h> 
using namespace std;
int t,x,y,k;
int g(int x, int y){
    int j = y;
    while(x > y){
        y += j;
    }
    return y;

}
int main()
{
    cin>>t;
    for(int i=0;i<t;i++){
        cin>>x>>y;
        cout<<g(x, y)<<endl;
    }
    

    return 0;
}
Copy
AZOZ with an O (EZ Version) sharawi
GNU G++17
836 ms
1.8 MB
Accepted