You are given an array a of length n consisting of integers. You can apply the following operation, consisting of several steps, on the array a zero or more times: 

  * you select two different numbers in the array a_i and a_j; 
  * you remove i-th and j-th elements from the array. 



For example, if n=6 and a=[1, 6, 1, 1, 4, 4], then you can perform the following sequence of operations: 

  * select i=1, j=5. The array a becomes equal to [6, 1, 1, 4]; 
  * select i=1, j=2. The array a becomes equal to [1, 4]. 



What can be the minimum size of the array after applying some sequence of operations to it?

Input

The first line contains a single integer t (1 ≤ t ≤ 10^4). Then t test cases follow.

The first line of each test case contains a single integer n (1 ≤ n ≤ 2 ⋅ 10^5) is length of the array a.

The second line of each test case contains n integers a_1, a_2, …, a_n (1 ≤ a_i ≤ 10^9).

It is guaranteed that the sum of n over all test cases does not exceed 2 ⋅ 10^5.

Output

For each test case, output the minimum possible size of the array after applying some sequence of operations to it.

Example

Input


5
6
1 6 1 1 4 4
2
1 2
2
1 1
5
4 5 4 5 4
6
2 3 2 1 3 1


Output


0
0
2
1
0
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define pb push_back
int prime[1000009];
void prime_seive()
{
   for(int i=2;i*i<1000009;i++)
   {
     // if(prime)continue;
      if(!prime[i])
      {
         for(int j=i*i;j<1000009;j+=i)
          prime[j]=1;
      }
   }
   // for(int i=2;i<1000009;i++)
   //  {
   //     if(!prime[i])
   //      cout << i << " ";
   //  }
   //  cout << endl;
}
long long myceil_ll(long long a,long long b)
{
   return (a+b-1)/b;
}
int myceil_int(int a,int b)
{
   return (a+b-1)/b;
}
void found(int key,int pos,int n,int &lcount,int &rcount)
{
   long long low=0,high=n;
   //if(b<0)return false;
   int count=0;
        while(low<high)
        {
           long long mid=(low+high)/2;
        //cout << low << " " << mid << " " << high << endl;
           if(mid>pos)
           {
             rcount++;high=mid;
           }
           else if(mid<pos)
           {
             lcount++;low=mid+1;
           }
           else
            return ;
        }
        return;
}
bool is_ans(int temp)
{
   int po=sqrt(temp);
   if(po*1ll*po==temp)
    return true;
  return false;
}
bool isvalid(char grid[][4],int r,int c)
{
   if(r<0 || r>=4 || c<0 || c>3)
    return false;
   if(grid[r][c]=='p'|| grid[r][c]=='X')
    return false;
   return true;
}
void findpath(char grid[][4],int i,int j,int& found)
{
   // cout << i << " " << j << endl;
    if(!isvalid(grid,i,j))return;
    if(grid[i][j]=='g')
    {
      cout << i << " " << j << endl;
      found=true;
      return;
    }
    if(isvalid(grid,i+1,j))
      findpath(grid,i+1,j,found);
    if(found)
    {
       cout << i << " " << j << endl;
       return ;
    }
    if(isvalid(grid,i,j+1))
      findpath(grid,i,j+1,found);
    if(found)
    {
      cout << i << " " << j << endl;
      return;
    }

}
bool equal(vector<int> diff)
{
   for(int i=1;i<diff.size();i++)
   {
     if(diff[i]!=diff[i-1])return false;
   }
   return true;
}
int LCSubStr(char* X, char* Y, int m, int n)
{
    // Create a table to store
    // lengths of longest
    // common suffixes of substrings.  
    // Note that LCSuff[i][j] contains
    // length of longest common suffix
    // of X[0..i-1] and Y[0..j-1].
 
    int LCSuff[m + 1][n + 1];
    int result = 0; // To store length of the
                    // longest common substring
 
    /* Following steps build LCSuff[m+1][n+1] in
        bottom up fashion. */
    for (int i = 0; i <= m; i++)
    {
        for (int j = 0; j <= n; j++)
        {
            // The first row and first column
            // entries have no logical meaning,
            // they are used only for simplicity
            // of program
            if (i == 0 || j == 0)
                LCSuff[i][j] = 0;
 
            else if (X[i - 1] == Y[j - 1]) {
                LCSuff[i][j] = LCSuff[i - 1][j - 1] + 1;
                result = max(result, LCSuff[i][j]);
            }
            else
                LCSuff[i][j] = 0;
        }
    }
    return result;
}
void t_c()
 {
   int n;
   cin >> n;
   int arr[n];
   for(int i=0;i<n;i++)
     cin >> arr[i];
   priority_queue<int> pq;
   map<int,int> mp;
   for(auto val:arr)
     mp[val]++;
   for(auto it:mp)
     pq.push(it.second);
   int first,second;
   while(!pq.empty())
   {
     first=pq.top();
     pq.pop();
     if(pq.empty())
     {cout << first << endl;return;}
     second=pq.top();
     pq.pop();
     first--;
     second--;
     if(first>0)
     pq.push(first);
     if(second>0)
     pq.push(second);
   }
   cout << first << endl;
 }
int main()
{
   //prime_seive();
  /*
  freopen("input.txt","r",stdin);
  freopen("output.txt","w",stdout);
  */
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t=1;
 cin >> t;
  for(int i=0;i<t;i++)
  {
     t_c();
  }
}