laozhang_123 @ 2023-10-24 12:47:55
#include<bits/stdc++.h>
using namespace std;
long long gcd(long long x,long long y){
if(y==0) return x;
else return gcd(y,x%y);
}
long long icm(long long x,long long y){
return x*y/gcd(x,y);
}
int main(){
long long a,b,cnt=0;
cin>>a>>b;
for(long long i=1;i<=b;i++){
for(long long j=i;j<=b;j++){
if(gcd(i,j)==a&&icm(i,j)==b)
cnt++;}}
cout<<cnt;
return 0;
}