There must be a formula for calculating the greatest common factor and the least common multiple of 45 and 50 by decomposing the quality factor

There must be a formula for calculating the greatest common factor and the least common multiple of 45 and 50 by decomposing the quality factor

50=2×5²
45=3²×5
The greatest common factor is 5