This algorithm takes two integers as input and returns their [[Greatest Common Divisor (GCD)]] as output. We can prove that [[Euclid's Algorithm]] terminates and produces the right output.
### Implementation
```run-python
def euclideangcd(m,n):
a = min(m,n)
b = max(m,n)
if a == 0:
return b
else:
return euclideangcd(b%a,a)
# test
print(euclideangcd(3926, 7820))
```