Source Code
#include <bits/stdc++.h>

using namespace std;

int solve(int x, int y){
    int constY = y;
    while(x > y){
        y += constY; 
    }
    return y;

}

int main()
{
    int n;
    cin >> n;

    for(int i=0; i<n; i++){
        int x, y;
        cin >> x >> y;
        cout << solve(x, y) << endl;

    }


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