#include<string>
#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
int x=0, y=0, num = 0;
while (t--)
{
cin >> x >> y;
if (x < y) {
cout << y<<endl;
continue;
}
if (x % y == 0)
cout << x<<endl;
else
{
cout << (((x / y) + 1) * y) << endl;
}
}
}