最小公倍数的优化算法思想为:最小公倍数等于两数之积除以最大公约数
#include<iostream>
#include<algorithm>
using namespace std;
main()
{
long long a,b;
cin>>a>>b;
int max1=max(a,b);
int other=a+b-max1;
long long ans,label=1,bns;
while(other)
{
bns=max1%other;//辗转相除法
max1=other;
other=bns;
}
cout<<a*b/max1;
}