#include <iostream>
using namespace std;
#define ll long long int
int main() {
ll t, first, second;
cin >> t;
while (t--) {
cin >> first >> second;
ll k = first;
if (k > second) {
while (k % second != 0) {
k++;
}
cout << k << endl;
}
else
cout << second << endl;
}
}