Compute the greatest common divisor and least common multiple of a set of integers.
辗转相除法求最大公约数,再求最小公倍数。
最大公约数(GCD)为两整数公有最大因子;最小公倍数(LCM)为最小公共倍数。满足 GCD(a,b)·LCM(a,b)=|a·b|。
约分、通分、周期对齐、模运算等。常用欧几里得算法(辗转相除)高效求解。