#include <iostream>
#include <vector>
using namespace std ;
vector <int> q(100) ;
vector <int> ans ;
void work()
{
int n ;
cin >> n ;
q.clear() ;
ans.clear() ;
long long x ;
for(int i = 0 ; i < n ; i ++ )
{
cin >> x ;
x = x % 10 ;
q[ x ] ++ ;
}
for(int i = 0 ; i < 10 ; i ++ )
{
for(int j = 0 ; j < 10 ; j ++ )
{
for(int k = 0 ; k < 10 ; k ++ )
{
if((i + j + k) % 10 != 3)
continue ;
q[i] -- , q[j] -- , q[k] -- ;
if(q[i] < 0 || q[j] < 0 || q[k] < 0 )
{
q[i] ++ ;
q[j] ++ ;
q[k] ++ ;
}
else
{
cout << "YES" << endl ;
return ;
}
}
}
}
cout << "NO" << endl ;
return ;
}
int main ()
{
int T ;
cin >> T ;
while ( T -- )
{
work() ;
}
return 0 ;
}
这个vector 没被clear清空为什么呀