蒟蒻开了氧气,80分
#include<iostream>
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b)
{
if(b == 0)
return a;
return gcd(b,a % b);
}
int main()
{
int a,b,ans = 0,num = 0;
cin >> a >> b;
if(a == b)
{
cout << 1;
return 0;
}
for(int i = 1;i <= b;i++)
{
for(int j = i + 1;j <= b;j++)
if(i * j == a * b && gcd(i,j) == a)
ans++;
}
cout << ans * 2;
return 0;
}