Chef and Game with Sequence

here i guess its a correct solution but its showing WA;
can you please help me with its logic.
‘’’
#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
long long int t;
cin>>t;
while(t–)
{
ll int n,odd=0,even=0;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
{

cin>>a[i];
if(a[i]%2==0)even++;
else odd++;

}
if(odd%2==0)cout<<1<<endl;
else cout<<2<<endl;

}
}

‘’’