Source Code
#include <iostream>
using namespace std;
int main(){
	int t;
	cin >> t;
	for (int i =0;i<t;i++){
		int x,y;
		cin >> x >> y;
		int val = x+y - (x % y);
		if (x%y == 0){
			cout << x;
		}
		else if (val % y == 0){
		cout << val;
		}
		else {
		cout << y;
		}
	}

}
Copy
AZOZ with an O (Needs a Carry) acaard
GNU G++17
4 ms
368 KB
Wrong Answer