## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

## [Solution] All Distinct Codeforces Solution | Codeforces Problem Solution 2022

B. All Distinct
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Sho has an array $a$ consisting of $n$ integers. An operation consists of choosing two distinct indices $i$ and $j$ and removing ${a}_{i}$ and ${a}_{j}$ from the array.

For example, for the array $\left[2,3,4,2,5\right]$, Sho can choose to remove indices $1$ and $3$. After this operation, the array becomes $\left[3,2,5\right]$. Note that after any operation, the length of the array is reduced by two.

After he made some operations, Sho has an array that has only distinct elements. In addition, he made operations such that the resulting array is the longest possible.

More formally, the array after Sho has made his operations respects these criteria:

• No pairs such that ($i) and ${a}_{i}={a}_{j}$ exist.
• The length of $a$ is maximized.

Output the length of the final array.

Input

The first line contains a single integer $t$ ($1\le t\le {10}^{3}$) — the number of test cases.

The first line of each test case contains a single integer $n$ ($1\le n\le 50$) — the length of the array.

The second line of each test case contains $n$ integers ${a}_{i}$ ($1\le {a}_{i}\le {10}^{4}$) — the elements of the array.

Output

For each test case, output a single integer — the length of the final array. Remember that in the final array, all elements are different, and its length is maximum.