Source Code
#include <iostream>
#include <string>
using namespace std;
int main() {
	int T, x, y;

	scanf("%d", &T);
	x = 0;
	while (T > 0) {

		if (x == 0) {
			scanf("%d%d", &x, &y);
		}
		if (x % y != 0) {
			x++;
		}

		else {
			printf("%d\n", x);
			x = 0;
			T--;
		}
	}


	return 0;
}
Copy
AZOZ with an O (EZ Version) safareto
GNU G++17
2057 ms
1.1 MB
Time Limit Exceeded