Write a function that computes the greatest common divisor of four natural numbers
*a*, *b*, *c* and *d*
using the *fast* version of the Euclidean algorithm.

**Interface**

C++,C | int gcd4(int a, int b, int c, int d); |

Java | public static int gcd4(int a, int b, int c, int d); |

Python | gcd4(a, b, c, d) # returns int |

gcd4(a: int, b: int, c: int, d: int) -> int |

**Precondition**

The four numbers are strictly greater than zero.

**Observation**
You only need to submit the required procedure;
your main program will be ignored.

**Hint**

Using the function *gcd(a, b)*
of the exercise P88790: “Iterative greatest common divisor”
should be useful.

Public test cases

**Input/Output**

gcd4(66, 12, 1200, 36) → 6

gcd4(10, 6, 21, 35) → 1

gcd4(10, 6, 21, 35) → 1

Information

- Author
- Salvador Roura
- Language
- English
- Translator
- Salvador Roura
- Original language
- Catalan
- Other languages
- Catalan
- Official solutions
- C C++ Java Python
- User solutions
- C C++ Python