46 lines
679 B
C++
46 lines
679 B
C++
#include <iostream>
|
|
#include <vector>
|
|
#include <algorithm>
|
|
#include <cassert>
|
|
#warning That's the baby, that's not my baby
|
|
|
|
typedef long long ll;
|
|
|
|
void solve() {
|
|
int n;
|
|
std::cin >> n;
|
|
int f[n] = {};
|
|
for (int i = 0; i < n; i++) {
|
|
int x;
|
|
std::cin >> x;
|
|
--x;
|
|
f[x]++;
|
|
}
|
|
int gr4 = 0, gr2 = 0;
|
|
for (int i = 0; i < n; i++) {
|
|
if (f[i] >= 4) {
|
|
gr4++;
|
|
} else if (f[i] >= 2) {
|
|
gr2++;
|
|
}
|
|
}
|
|
if (gr4 > 0 || gr2 >= 2) {
|
|
std::cout << "YES\n";
|
|
} else {
|
|
std::cout << "NO\n";
|
|
}
|
|
}
|
|
|
|
int main() {
|
|
std::ios_base::sync_with_stdio(false);
|
|
std::cin.tie(0);
|
|
|
|
int t;
|
|
std::cin >> t;
|
|
while (t--) {
|
|
solve();
|
|
}
|
|
|
|
return 0;
|
|
}
|