Source Code
#include <iostream>

using namespace std;
int main()
{
    int t;
    cin >> t;
    for (int i = 0; i < t; i++) {
        int x, y;
        cin >> x >> y;

        int j = x + 1;

        if (y > x) {
            cout << y << endl;
            continue;
        }

        while (j % y != 0) {
            j++;
        }
        cout << j << endl;
    }
}
Copy
AZOZ with an O (EZ Version) lufa3
GNU G++17
1081 ms
1.2 MB
Wrong Answer