CF1728A.Colored Balls: Revisited

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Colored Balls: Revisited

The title is a reference to the very first Educational Round from our writers team, Educational Round 18.

There is a bag, containing colored balls. There are nn different colors of balls, numbered from 11 to nn. There are cnti\mathit{cnt}_i balls of color ii in the bag. The total amount of balls in the bag is odd (e. g. $\mathit{cnt}_1 + \mathit{cnt}_2 + \dots + \mathit{cnt}_n$ is odd).

In one move, you can choose two balls with different colors and take them out of the bag.

At some point, all the remaining balls in the bag will have the same color. That's when you can't make moves anymore.

Find any possible color of the remaining balls.

Input

The first line contains a single integer tt (1t10001 \le t \le 1000) — the number of testcases.

The first line of each testcase contains a single integer nn (1n201 \le n \le 20) — the number of colors.

The second line contains nn integers $\mathit{cnt}_1, \mathit{cnt}_2, \dots, \mathit{cnt}_n$ (1cnti1001 \le \mathit{cnt}_i \le 100) — the amount of balls of each color in the bag.

The total amount of balls in the bag is odd (e. g. $\mathit{cnt}_1 + \mathit{cnt}_2 + \dots + \mathit{cnt}_n$ is odd).

Output

For each testcase, print a single integer — any possible color of the remaining balls, after you made some moves and can't make moves anymore.

Note

In the first testcase, your first and only move can be one of the following:

  • take balls with colors 11 and 22;
  • take balls with colors 11 and 33;
  • take balls with colors 22 and 33.

After the move, exactly one ball will remain. Its color can be 3,23, 2 or 11 depending on the move.

In the second testcase, you can't make moves at all — there is only color of balls already. This color is 11.

In the third testcase, you can keep removing one ball of color 11 and one ball of color 22 until there are no more balls of color 11. At the end, three balls of color 22 remain.

Samples

3
3
1 1 1
1
9
2
4 7
3
1
2

在线编程 IDE

建议全屏模式获得最佳体验