You start with an integer array $$$a$$$, which initially consists of $$$n$$$ zeros. You have to perform the following action exactly $$$n$$$ times:
You are given an array $$$b$$$, consisting of $$$n$$$ integers. Your task is to choose such values $$$l$$$ and $$$r$$$ for each action that:
What's the maximum possible value of $$$r - l + 1$$$?
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.
The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^{5}$$$) — the length of the array $$$b$$$.
The second line of each test case contains $$$n$$$ integers $$$b_{i}$$$ ($$$0 \le b_{i} \le n$$$) — the elements of the array $$$b$$$.
Additional constraints on the input:
For each test case, output one integer — the answer to the problem.
350 5 1 0 133 2 151 1 1 1 1
331
Consider the first test case. If the $$$n$$$ actions were as follows:
The array $$$a = [1, 1, 5, 0, 0]$$$, so you can reorder the elements to make it equal to $$$[0, 5, 1, 0, 1]$$$. As can be seen in this case, the maximum value of $$$r - l + 1$$$ is $$$3$$$. It can be shown that this is the optimal answer.
In the second test case:
The answer is $$$3$$$.
| Name |
|---|


