You are given a string $$$s$$$ of lowercase Latin letters. You need to rearrange the characters of $$$s$$$ to form a new string $$$t$$$ such that the following value is maximized:
$$$$$$\min(\mathrm{LCS}(s, t), \mathrm{LCS}(s, \overline{t})).$$$$$$
Note:
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^3$$$) — the number of test cases.
Each test case consists of a single integer $$$n$$$ ($$$1 \le n \le 5 \cdot 10^3$$$) — the length of the string $$$s$$$ followed by $$$s$$$ on a new line.
It is guaranteed that the sum of $$$n$$$ over all test cases doesn't exceed $$$5 \cdot 10^3$$$.
For each test case, print a single integer — the maximum possible value of the above expression among all rearrangements $$$t$$$ of $$$s$$$.
54abcd5abcba3aaa12adhocsmatter7abccabc
2 5 3 7 5