#include <iostream>
using namespace std;
int main() {
int T, x, y;
cin >> T;
while (T--) {
cin >> x >> y;
if (x <= y) {
cout << y << endl;
}
else {
int mult = x/y;
if (x % y != 0)
mult++;
int answer = y * mult;
cout << answer << endl;
}
}
}