#include <iostream>
#include <math.h>
using namespace std;
int main() {
int T;
float x, y;
cin >> T;
while (T--) {
cin >> x >> y;
float div = x/y;
int mult = ceil(div);
int answer = y * mult;
cout << answer << endl;
}
}