tijie
2025-12-19 19:13:37
发布于:湖北
8阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,f=1;
cin>>n;
for(int i=1;i<=n;i++){
long long sj[100005];
int nsz;
cin>>nsz;
for(int i=0;i<nsz;i++){
cin>>sj[i];
}
sort(sj,sj+nsz);
for(int i=0;i<nsz;i++){
if(sj[nsz-1]%sj[i]!=0){
f=0;
}
}
if(f==0){
cout<<"No"<<endl;
}else{
cout<<"Yes"<<endl;
}
f=1;
}
return 0;
}
这里空空如也







有帮助,赞一个