自己看
2026-08-16 17:14:36
发布于:广东
2阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll t;
ll a[10010];
ll n;
int main(){
//freopen(".in","r",stdin);
//freopen(".out","w",stdout);
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cout.tie(nullptr);
cin>>t;
while(t--){
cin>>n;
for(ll i=1;i<=n;i++) cin>>a[i];
ll ma=-1e18;
for(ll i=1;i<=n;i++) if(a[i]>ma) ma=a[i];
bool ok=1;
for(ll i=1;i<=n;i++){
if(ma%a[i]!=0){
ok=0;
break;
}
}
if(ok) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
//fclose(stdin);
//fclose(stdout);
return 0;
}
//coder::by::M91
这里空空如也






有帮助,赞一个