Pergunta de entrevista da empresa Deutsche Bank

find gcd if have factorization of both numbers