问题4128--Tao God and Jiong King II

4128: Tao God and Jiong King II

[命题人 : ]
时间限制 : 1.000 sec  内存限制 : 128 MB

题目描述

Today Tao God invite Jiong King to join his party of heaven.It’s wellknown to us,Tao God is the leader of heaven and Jiong King is the leader of hell.To welcome for Jiong King’coming,Tao God come up with a game to play with Jiong King.Tao God select a number A and Jiong King select a number B.Their value of happiness is the sum of the common divisors of A and B.
If X can be divided by Y, we call Y is a divisor of X. For example, 3 is a divisor of 6.Now, give you Tao God’selection A and Jiong King’selection B,please help them calculate their value of happiness.

输入

The input file consists of multipe test cases.

Each tast case only contains two numbers A and B.

(1 <= A, B <= 100000000)

 

输出

Output their value of happiness.

样例输入 Copy

5 10
6 8

样例输出 Copy

6
3

来源/分类

JayYe