#include <stdio.h>
int gcd(int a, int b) {
if(a<b) {
int tmp=a;
a=b;
b=tmp;
}
int r=a%b;
while(r>0) {
a=b;
b=r;
r=a%b;
}
return b;
}
int main() {
int n;
scanf("%d",&n);
while(n--) {
int a,b;
scanf("%d %d",&a, &b);
printf("%d\n",a*b/gcd(a,b));
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: