#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 j = x+1; while (j % y != 0) { j++; } cout << j << endl; } }