Problem1004--GCD of many integers

1004: GCD of many integers

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

Given N positive integers, please output the GCD of all the N integers. N <= 100,000, the value of integer is less than 1000000000. 

Input

The first line is integer N
The second line contains N integers

Output

One integer which is the GCD of all the integers in the list

Sample Input Copy

5
28 4 8 6 14 

Sample Output Copy

2

Source/Category