题解:「TBOI Round 1」Niton & LCM
只考虑
:::success[点击查看参考代码]
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;ll k;
void slv(){
cin>>n>>k;
ll g=1;bool f=0;
for(int i=1;i<=n;i++){
ll a;cin>>a;
if(k%a)continue;
g=g/__gcd(g,a)*a,f=1;
}
if(g==k&&f)puts("Yes");
else puts("No");
}
int main(){
int T;cin>>T;
while(T--)slv();
return 0;
}
:::