링크 : https://www.acmicpc.net/problem/1934
/*
문제 : 최소공배수
링크 : https://www.acmicpc.net/problem/1934
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int gcd(int a, int b) {
while (b != 0) {
int r = a % b;
a = b;
b = r;
}
return a;
}
int main(){
int n;
cin >> n;
for(int t = 0; t < n; t++){
int A, B;
cin >> A >> B;
int g = gcd(A, B);
cout << A * B / g << '\n';
}
return 0;
}