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