Source Code
#include <iostream>
using namespace std;

int main() {
	int n;
	cin>>n;
	long int ans[n];
	for(int i=0;i<n;i++){
		long int x, y;
		cin>>x>>y;
		for(int j=x;;j++){
			if(j%y==0){
				ans[i]=j;
				break;
			}
		}
	}
	for(int i=0;i<n;i++){
		cout<<ans[i]<<endl;
	}
	
	return 0;
}
Copy
AZOZ with an O (EZ Version) samihamad
GNU G++17
2071 ms
788 KB
Time Limit Exceeded