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;
		while (j % y != 0) {
			j++;
		}
		cout << j << endl;
	}
}

Copy
AZOZ with an O (EZ Version) lufa3
GNU G++17
2082 ms
1.0 MB
Time Limit Exceeded