#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
{
long int temp = ceil(x/y);
cout<<temp*y<<endl;
}
}
}