#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;
if (first <= second)
cout << second << endl;
else if (k > second) {
if (second == 1)
cout << k;
else {
ll k = ceil(first / second) * second;
cout << k << endl;
}
}
}
}