#include<iostream>
#include <math.h>
using namespace std ;
int main()
{
int t ;
cin>>t;
while(t--)
{
double x ,y;
cin>>x>>y;
if(y>x) cout<<y<<endl;
else
{
double temp = ceil(x/y);
cout<<temp*y<<endl;
}
}
}