eolymp
bolt
Try our new interface for solving problems
Problems

The greatest common divisor

The greatest common divisor

$n$ positive integers are given. Find the greatest common divisor of these numbers. \InputFile The first line contains one integer $n~(n \le 1000)$. The second line contains $n$ positive integers, each does not exceed $2 \cdot 10^9$. \OutputFile Print the greatest common divisor of given numbers.
Time limit 1 second
Memory limit 128 MiB
Input example #1
5
125 80 67835 1000 25
Output example #1
5
Source ЛКШ 2009