Why the Euclidean algorithm finds the greatest common divisor: from subtraction to division