Source Code
#include <iostream>
using namespace std;
const int N = 1e5 + 5;
int main() {
	int T, x, y, z;

	cin >> T;

	while (T--) {
		cin >> x >> y;

		if (x <= y) {
			cout << y << endl;
		}

		else {
			int z = (x % y) + x + 1;

			cout << z << endl;
		}
	}
	return 0;
}
Copy
AZOZ with an O (EZ Version) safareto
GNU G++17
266 ms
1.3 MB
Wrong Answer