1379: 中级班第一课——找公约数

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:223 Solved:6

Description

    如果有一个数既是a的约数,又是b的约数,我们就称该数为ab的公约数。编程序找出ab的所有公约数。

Input

 两个整数ab,用空格隔开。

Output

 所有的公约数,每个公约数占一行。

Sample Input Copy

10 35

Sample Output Copy

1
5

Source/Category