Source Code
#include <iostream>
using namespace std;
int main() {
	int x, y, counter = 0, n, k;
	int a[100000], b[100000];
	cin >> n;


	for (int i = 0; i < n; i++) {
		cin >> x >> y;
		if (x == y) {
			b[counter] = x;
			counter++;
		}
		else {
		for (int i = 0; i < 10000; i++) {

			a[i] = i * y;
			if ((a[i] > x) && (a[i] % y == 0)) {
				k = a[i];
				b[counter] = k;
				counter++;

				break;

			}
		}
	}
}
	for (int j = 0; j < n; j++) {
		
		cout << b[j] << endl;
	}
	

	return 0;
}
Copy
AZOZ with an O (EZ Version) Reem12
GNU G++17
227 ms
1.5 MB
Wrong Answer