calc_gcd_and_lcm