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

80 人解决,97 人已尝试。

95 份提交通过,共有 245 份提交。

3.3 EMB 奖励。

创建: 15 年,5 月前.

修改: 6 年,8 月前.

最后提交: 6 月前.

来源: ECNU 选拔 2008

题目标签