代码:
#include<stdio.h>
int main()
{
int gcd(long long a,long long b);
int t;
long long a,b,c,lcm;
scanf("%d",&t);
while(t--)
{
scanf("%lld%lld",&a,&b);
c=gcd(a,b);
lcm=a/c*b;
printf("%lld\n",lcm);
}
return 0;
}
int gcd(long long a,long long b)
{
if(b==0)
return a;
return gcd(b,a%b);
}