#include<iostream>
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 long temp = x/y;
if(temp*y >=x )cout<<temp*y<<endl;
else cout <<(temp+1) * y <<endl;
// cout<<temp*y<<endl;
}
}
}