Source Code
#include <iostream>
using namespace std;

int main() {
	int n;
	cin>>n;
	int ans[n];
	for(int i=0;i<n;i++){
		int x, y;
		cin>>x>>y;
		for(int j=x;;j++){
			if(j%y==0){
				ans[i]=j;
				break;
			}
		}
		cout<<ans[i]<<endl;
	}

	
	return 0;
}
Copy
AZOZ with an O (EZ Version) samihamad
GNU G++17
2063 ms
1.3 MB
Time Limit Exceeded