P14113 [CodeChef] CUCRLINE
提高+
题目描述

While playing in the plains, Chef found a point A with coordinates (X, Y).

Chef is interested in finding the number of [straight lines] passing through the point A such that their [intercepts] on both axes are positive integers.

------ Input Format ------

  • First and only line of input contains two integers X and Y - the coordinates of the point A.

------ Output Format ------

  • For each test case, print an integer - the number of lines satisfying the given conditions.

------ Constraints ------

$1 ≤ X ≤ 10^{12}$
$1 ≤ Y ≤ 10^{12}$

----- Sample Input 1 ------
3 2
----- Sample Output 1 ------
4
----- explanation 1 ------
There are $4$ lines satisfying all the conditions. These lines are:

![image]

----- Sample Input 2 ------
1 2
----- Sample Output 2 ------
2
----- explanation 2 ------
There are $2$ such lines, which are :

![image]

----- Sample Input 3 ------
28 206
----- Sample Output 3 ------
16
----- explanation 3 ------
There are $16$ such lines.

输入格式

见题面

输出格式

见题面

样例输入
3 2
样例输出
4