Read a natural number n followed by n positive natural numbers.
Print the greatest common divisor (GCD) of all n numbers, computed using a recursive function based on Euclid's algorithm.
Define a recursive function cmmdc(a, b) with the relation:
cmmdc(a, 0) = a
cmmdc(a, b) = cmmdc(b, a % b), for b > 0Then compute the GCD of all n numbers by successive reduction: start with the first number and combine it one by one with each of the remaining numbers using cmmdc.