#include<stdio.h>
#include<iostream>
#include<math.h>
int main()
{
int A,B,n,q,r;
scanf("%d%d",&A,&B);
if(A>=1&&B>=1&&A<=pow(10,9)&&B<=pow(10,9)) //要求1<=A,B<=10^9。
{
n=A*B; //A与B的乘积。
while(1) //循环
{
q=A/B;
r=A%B;
if(r==0) //r=0,则B为A与B的最大公约数。
{
n=n/B; // n/B的A与B的最小公倍数。
printf("%d\n",n);
break; //跳出循环。
}
else
{
A=B; //辗转相除法求最大公约数。
B=r;
}
}
#include<iostream>
#include<math.h>
int main()
{
int A,B,n,q,r;
scanf("%d%d",&A,&B);
if(A>=1&&B>=1&&A<=pow(10,9)&&B<=pow(10,9)) //要求1<=A,B<=10^9。
{
n=A*B; //A与B的乘积。
while(1) //循环
{
q=A/B;
r=A%B;
if(r==0) //r=0,则B为A与B的最大公约数。
{
n=n/B; // n/B的A与B的最小公倍数。
printf("%d\n",n);
break; //跳出循环。
}
else
{
A=B; //辗转相除法求最大公约数。
B=r;
}
}