https://numbas.mathcentre.ac.uk/question/19575/blathnaid-s-copy-of-apply-extended-euclidean-algorithm-to-find-gcd/embed/