Codeforces Round 1069 (Div. 2)
A
Little Fairy's Painting
Codeforces
800
原题
←B →
翻译中…

The little fairy has a ribbon with $10^{18}$ cells and an infinite variety of colors. The first $n$ cells of the ribbon have already been colored, where the $i$-th cell is colored with color $a_i$.

翻译中…

Little fairy will color the remaining cells in order from $n+1$ to $10^{18}$. For the $i$-th cell:

翻译中…
  • Little fairy first counts the number of distinct colors currently present on the ribbon, denoted as $c_i$.
  • Then she will color the $i$-th cell with color $c_i$.
翻译中…

What color will the fairy use for the $10^{18}$-th cell?

翻译中…

Input

翻译中…

Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 500$). The description of the test cases follows.

翻译中…

The first line of each test case contains a single integer $n$ ($1 \le n \le 100$) — the number of colored cells.

翻译中…

The second line of each test case contains $n$ integers $a_1,a_2,\ldots,a_n$ ($1 \le a_i \le 10^3$) — the colors of the cells.

翻译中…

Output

翻译中…

For each test case, print the color of the last cell.

翻译中…

Note

翻译中…

In the first example, each time there is only one distinct color on the ribbon, so the fairy always chooses the color $1$.

翻译中…

In the second example, the fairy will color the next $1000$ cells with colors from $1$ to $1000$ sequentially, after that all next cells will be colored with color $1000$.

翻译中…

样例

Input #1
5
6
1 1 1 1 1 1
1
1000
5
8 10 15 20 25
8
2 5 2 4 1 2 5 3
6
40 4 1 95 8 40
Output #1
1
1000
8
5
8
InputCopy OutputCopy
题目信息
题号
2175A
时间限制
1 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。