greatest common divisor (gcd) / euclid's algorithm