A Dividing Problem

View as PDF

Submit solution

Points: 5
Time limit: 1.0s
Memory limit: 64M

Author:
Problem types

Given an array a, print the largest positive number that divides all the elements in a.

Input Specification

The first line will contain the integer N (1 \le N \le 100).

The second line will contain N integers, a_1, a_2, \ldots, a_N (1 \le a_i \le 10^9).

Output Specification

Print the largest positive number that divides all elements in a.

Sample Input

3
30 5 10

Sample Output

5

Comments

There are no comments at the moment.