#K39792. GCD of Maximum and Minimum

    ID: 26499 Type: Default 1000ms 256MiB

GCD of Maximum and Minimum

GCD of Maximum and Minimum

You are given an array of integers. The task is to compute the greatest common divisor (GCD) of the maximum and minimum numbers present in the array.

Let \( \max \) be the maximum element and \( \min \) be the minimum element of the array. You need to find \( \gcd(\max,\min) \).

The input will be provided through standard input (stdin) and the answer should be printed to standard output (stdout).

inputFormat

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

outputFormat

Output a single integer which is the greatest common divisor of the maximum and minimum numbers in the array.

## sample
5
2 5 6 9 10
2