Rahul is a serial killer. Rahul has been betrayed by his lover in the past and now he want to eliminate entire Universe.He has already Eliminated majority of the population and now only a handful number of people are left. Like other Serial killers, he has an interesting pattern of killing people. 
He either kill one individual at a time or if he find two individuals of different heights,he eliminates both of them simultaneously. Now Rahul wants to eliminate them as quickly as he can.
So given $N$ as the number of people left and an array containing height of those $N$ people,tell the minimum number of kills Rahul require to eliminate the entire universe.
-----Input:-----
- First line will contain $T$, number of testcases. Then the testcases follow. 
- Each test case constitutes of Two lines. 
- First line contains $N$, representing the number of people left in the universe
- The second line contains an array $a[i]$ of size $N$ containing heights of those $N$ people.
-----Output:-----
For each testcase, you have to output a Single line Containing the minimum number of kills required by Rahul to eliminate the Universe.
-----Constraints-----
- $1 \leq T \leq 50000$
- $1 \leq N \leq 50000$
- $100 \leq a[i] \leq 10^5$
-----Sample Input:-----
1
10
178 184 178 177 171 173 171 183 171 175
-----Sample Output:-----
5
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]

for _ in range(inp()):
    n = inp()
    x = ip()
    dt = {} 
    for i in x: dt[i] = dt.get(i,0)+1
    ans = max(max(dt.values()),(n-1)//2+1)
    print(ans)
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]

for _ in range(inp()):
    n = inp()
    x = ip()
    dt = {} 
    for i in x: dt[i] = dt.get(i,0)+1
    ans = max(max(dt.values()),(n-1)//2+1)
    print(ans)