#include <stdio.h>
int main(){
long long x;
int y,T;
scanf("%d",&T);
for(int i=0;i<T;i++){
scanf("%lld %d",&x,&y);
if(x>=y){
long long k=(x/y);
printf("%lld\n",(k+1)*y);
continue;
}
else{
printf("%d\n",y);
continue;
}
}
}