#include <iostream>
using namespace std;
//int N = 10e5+1;
int main(){
int t;
cin >> t;
long long x, y;
while(t){
cin >> x >> y;
int k = x+(y-(x%y));
if(x%y==0){
cout<<x<<endl;
}
else if(x <= y) {
cout << y << endl;
}
else{
cout<<k<<endl;
}
t--;
}
}