-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcc_T23.cpp
More file actions
48 lines (39 loc) · 683 Bytes
/
cc_T23.cpp
File metadata and controls
48 lines (39 loc) · 683 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
Author : Abhinav
Modified : 19-07-2018 12:21:21 PM
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
#define faster ios_base::sync_with_stdio(false);cin.tie(0);
const ll mod = 1e9+7;
#define rep(i,j,k) for(ll i=j; i<k; i++)
#define repv(i,j,k) for(ll i=j; i>k; i--)
int main(){
faster;
ll t,n;
cin >> t;
while(t--){
cin >> n;
vi v(n);
int flag=0;
rep(i,0,n)
cin >> v[i];
sort(v.begin(), v.end());
rep(i,0,n){
for(int j=i+1; j<n; j++){
if(__gcd(v[i],v[j])==1){
cout << "YES\n";
flag=1;
break;
}
}
if(flag)
break;
}
if(!flag)
cout << "NO\n";
}
return 0;
}