CodeLab Academy 📞 9936 6696
← List Python · Level 10: Algorithms Code · 100 points ← #931 #933 →

#932. GCD of a list

Find the greatest common divisor (GCD) of all elements of the list. ### Input The first line has n, the second line has n integers separated by spaces. (positive numbers) ### Output A number.

Examples

Input
10
42 84 28 112 35 203 84 28 49 112
Output
7
Input
1
126
Output
126

💡 You can solve it with Python, JavaScript or blocks. Read the input line by line with input(). Don't print a question (like input("Number: ")). Print exactly what the output asks for, nothing more.

🔒 You can solve the first 3 problems without an account. Sign up for free to solve this one!