#include <iostream>
#include <vector>
using namespace std;
int main() {
int t; cin >> t;
while (t--) {
int n, k; cin >> n >> k;
if (n % k == 0) {
cout << n << endl;
continue;
}
cout << k*((n / k) + 1) << endl;;
}
return 0;
}