2434. Greatest Common Divisor

单点时限: 3.0 sec

内存限制: 256 MB

Your task is to find a greatest common divisor(GCD) from given integers.

输入格式

Input consists from multiple test cases.The first line of each test case contains single positive integer n (1 < n < 1024) which indicates the number of integers to find a GCD. Next line contains n positive integers separated by a single space. You have to calculate a GCD from these integers. A single line containing 0 denotes the end of input.

You can assume that input integers always fit in 32-bit signed integer.

输出格式

For each test case, you should output a GCD for each line.

样例

Input
2
4 10
0
Output
2

82 人解决,99 人已尝试。

97 份提交通过,共有 247 份提交。

3.2 EMB 奖励。

创建: 16 年前.

修改: 7 年,3 月前.

最后提交: 3 周前.

来源: ECNU 选拔 2008

题目标签