#K14786. Largest Common Divisor

    ID: 24212 Type: Default 1000ms 256MiB

Largest Common Divisor

Largest Common Divisor

Given an array of n unique integers, your task is to find the largest integer \( k \) such that each number in the array is divisible by \( k \) without any remainder. In other words, compute the greatest common divisor (GCD) of the array of numbers.

The input consists of an integer \( n \) followed by \( n \) space-separated integers. The output should be a single integer, which is the largest common divisor that satisfies the condition.

Note: If the array contains only one number, then that number itself is the answer.

inputFormat

The first line of input contains a single integer \( n \) which indicates the number of elements in the array. The second line contains \( n \) space-separated integers representing the array elements.

outputFormat

Output a single integer — the largest common divisor \( k \) that divides all the numbers in the array without a remainder.

## sample
1
10
10