1.gcd
__gcd(a,b) 头文件<algorithm>
1 LL gcd(LL a,LL b) 2 { 3 LL t; 4 while (b) 5 { 6 t=b; 7 b=a%b; 8 a=t; 9 } 10 return a; 11 }
2.lcm
1 lcm=a/gcd(a,b)*b