#include #include #include #include #include using namespace std; map,bool>memo; bool naive(vectorA) { if(A.empty())return false; sort(A.begin(),A.end()); if(memo.find(A)!=memo.end())return memo[A]; bool win=false; for(int i=0;i=2); int x=A[i]; auto test=[&](int a){ vectorB=A; B.erase(B.begin()+i); if(a>=2)B.push_back(a); return naive(B); }; bool out=false; for(int a=1;a+a<=x;a++) { int b=x-a; if(test(a)&&test(b)) { out=true; break; } } if(!out) { win=true; break; } } return memo[A]=win; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); /* const int L=30; vectorwin; for(int a=2;a<=L;a++) { if(naive({a})) { cout<<"win : "<>T; for(;T--;) { int N;cin>>N; int win=0,three=0; for(;N--;) { long a;cin>>a; if(a==3)three++; else if(a%10==2||a%10==3||a%10==7||a%10==8)win++; } cout<<(win%2||three%2?"First\n":"Second\n"); } }