let input = require('fs').readFileSync('/dev/stdin').toString().trim().split('\n');
const N = +input.shift();
const sol = (input) => {
const [a, b] = input.split(" ").map(Number);
const greatest = (a, b) => {
if (b === 0) return a;
return greatest(b, a % b);
};
const least = (a, b) => (a * b) / greatest(a, b);
return least(a, b);
};
for (let x of input) {
console.log(sol(x));
}