查找两个给定集之间的数字计数,使得集合A具有数字因子,而数字是集合B的因子
int getTotalX(vector <int> a, vector <int> b) {
int c=0;
long int hcf=findGCD(b,b.size()); //find hcf of set a
long int lcm=findlcm(a,a.size()); //find lcm of set b
if(lcm<=hcf)
{
for(int i=lcm;i<=hcf;i++)
{
if(hcf%i==0 && i%lcm==0) //to check for a no between two sets
c++;
}
return c;
}
else return 0;
}