Croc Champ 2013 - Round 2 (Div. 2 Edition)
A
Ksusha and Array
Codeforces
1000
原题
←B →
翻译中…

Ksusha is a beginner coder. Today she starts studying arrays. She has array $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$, consisting of $*n*$ positive integers.

翻译中…

Her university teacher gave her a task. Find such number in the array, that all array elements are divisible by it. Help her and find the number!

翻译中…

Input

翻译中…

The first line contains integer $*n*$ $(1 ≤ *n* ≤ 10^{5})$, showing how many numbers the array has. The next line contains integers $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$ $(1 ≤ *a*_{*i*} ≤ 10^{9})$ — the array elements.

翻译中…

Output

翻译中…

Print a single integer — the number from the array, such that all array elements are divisible by it. If such number doesn't exist, print -1.

翻译中…

If there are multiple answers, you are allowed to print any of them.

翻译中…

样例

Input #1
3
2 2 4
Output #1
2
InputCopy OutputCopy
Input #2
5
2 1 3 1 6
Output #2
1
InputCopy OutputCopy
Input #3
3
2 3 5
Output #3
-1
InputCopy OutputCopy
题目信息
题号
299A
时间限制
2 s
内存限制
256 MB
标签
暴力
数论
排序

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。