本站于2023年9月4日。收到“大连君*****咨询有限公司”通知
说我们IIS7站长博客,有一篇博文用了他们的图片。
要求我们给他们一张图片6000元。要不然法院告我们
为避免不必要的麻烦,IIS7站长博客,全站内容图片下架、并积极应诉
博文内容全部不再显示,请需要相关资讯的站长朋友到必应搜索。谢谢!
另祝:版权碰瓷诈骗团伙,早日弃暗投明。
相关新闻:借版权之名、行诈骗之实,周某因犯诈骗罪被判处有期徒刑十一年六个月
叹!百花齐放的时代,渐行渐远!
Hankson 的趣味题
- 简单推一下式子,发现\(gcd(x/a1,a0/a1)=1,gcd(b1/b0,b1/x)\)
- 直接枚举会超时
- 设\(x=k*a1\)则\(k|(b1/a1)\),枚举\(b1/a1\)的约数就可以了
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define U(i,u) for(register int i=head[u];i;i=nxt[i])
#define rep(i,a,b) for(register int i=(a);i<=(b);++i)
#define per(i,a,b) for(register int i=(a);i>=(b);--i)
#define Fast_cin ios::sync_with_stdio(false), cin.tie(0);
using namespace std;
typedef double db;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef __int128 ill;
typedef unsigned int ui;
typedef pair<int,int> PII;
typedef vector<int> VI;
template<class T> inline void read(T &x){x=0;char c=getchar();int f=1; while(!isdigit(c)){if(c=='-')f=-1;c=getchar();} while(isdigit(c)){x=x*10+c-'0';c=getchar();}x*=f; }
template<class T> inline void print(T x) {if(x<0)putchar('-'),x =-x;if(x < 10)putchar(x + 48);else print(x/10),putchar(x%10+48);}
template<class T> inline void cmin(T &x, T y){x=x<y?x:y;}
template<class T> inline void cmax(T &x, T y){x=x>y?x:y;}
int n,a0,a1,b0,b1;
int gcd(int x,int y){
if(y==0)return x;
return gcd(y,x%y);
}
int main(){
read(n);while(n--){
read(a0);read(a1);read(b0);read(b1);int tmp=0;
if(b1%a1!=0){printf("%d\n",tmp);continue;}int dd=b1/a1;
rep(i,1,sqrt(dd)){
if(dd%i==0){
if(gcd(i,a0/a1)==1&&gcd(b1/b0,dd/i)==1)++tmp;
if(i*i!=dd){
if(gcd((dd/i),a0/a1)==1&&gcd(b1/b0,i)==1)++tmp;
}
}
}
printf("%d\n",tmp);
}
return 0;
}