#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll res,p,q;
ll gcd (ll a,ll b){
if(b==0) return a;
return gcd(b,a%b);
}
int main(){
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
ll x,y;cin>>x>>y;
ll t=x*y;
p=x;
while(p*p <=t){
if(p*p==t) res--;
q=t/p;
if(p*q==t)
if(gcd(q,p)==x) res+=2;
p+=x;
}
cout<<res;
return 0;
}
这可真是怪事,只有我是这样吗,我看大伙代码都不判q是不是正整数来着.....