#include <iostream>
#include <math.h>
using namespace std;
#define ll long long int
int main() {
ll t;
double first, second;
cin >> t;
while (t--) {
cin >> first >> second;
double k = first;
if (k <= second)
cout << second << endl;
else if (k > second) {
cout << second * ceil(k / second) << endl;
}
}
}