http://ybt.ssoier.cn:8088/problem_show.php?pid=1915
#include<cstdio>
int n,m,i,ans,t;
int gcd(int x,int y)
{
int tmp;
while( y )
{
tmp=x%y;
x=y;
y=tmp;
}
return x;
}
/*
int gcd(int x,int y)
{
if( y==0)
{
return x;
}
else
{
return gcd(y,x%y);
}
//return!y?x:gcd(y,x%y);
}
int Eud(int M, int N){
int tmp;
while (N > 0) {
tmp = M % N;
M = N;
N = tmp;
}
return M;
}
*/
int main()
{
scanf("%d%d",&n,&m);
//每次增加应该是增加n,比如 3 60样例
//显然所求的两个数都是3的整数倍,所以每次加3既可
for(i=n;i<=m;i+=n)
//∵i*j=n*m ∴j=n*m/i ∴只要枚举i既可
if((m*n)%i==0 && gcd(m*n/i,i)==n)
ans++;
printf("%d",ans);
return 0;
}