This is the conclusion of the story from the problem "Codeforces Round (1025) A. It's Time to Duel."
At the end of the Yu-Gi-Oh! tournament, it was time to give out the prizes. The biggest prize was a rare copy of the card "Blue Eyes White Dragon."
But then, something bad happened: someone stole the card. This made Mouf, the person in charge of the tournament, very angry. He thought that everyone in the tournament knew who the thief was, but they were too scared to say anything.
To find out the truth, Mouf came up with a plan. He lined up all the $$$n$$$ players and gave each one a number from $$$1$$$ to $$$n$$$. Then he asked them, "What is the difference between your number and the thief's number?" This question created a list called $$$a$$$, where $$$a_i$$$ was the answer from player number $$$i$$$.
However, exactly one player lied about their distance from the thief. Now, Mouf needs your help to figure out who the thief is or to declare that it's impossible to find out.
Note that the liar may be the one who stole the prize.
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$$$ $$$(2 \le n \le 10^5)$$$ — the number of players in the tournament.
The second line of each test case contains $$$n$$$ integers $$$a_1,a_2,…,a_n$$$ $$$(0 \le a_i \le n-1)$$$ — denoting the answer from player number $$$i$$$.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^5$$$, and that each test case contains exactly 1 liar.
For each test case output in a single line the thief number or $$$-1$$$ if it is impossible to find out the thief.
621 132 0 030 1 043 1 2 341 0 1 051 3 1 2 3
-1 3 -1 1 2 2
| Название |
|---|


