为啥if加上就AC,不加就60TLE
#include<bits/stdc++.h>
#define int long long
using namespace std;
int t;
int lcm(int x,int y) {
return x/__gcd(x,y)*y;
}
signed main() {
cin>>t;
while(t--) {
int a,b,c,d;
cin>>a>>b>>c>>d;
int e=a/b;
int f=c/d;
int ans=0;
for(int i=1; i*i<=d; i++) {
if(d%i==0) {
if(__gcd(i,a)==b&&lcm(i,c)==d) {
ans++;
}
int y=d/i;
if(y!=i&&__gcd(y,a)==b&&lcm(y,c)==d) {
ans++;
}
}
}
cout<<ans<<endl;
}
}