Limits 1s, 512 MB

Alex Jhon is a very good man in his village. He always helps his neighbors and poor people as much as he can. He has achieved love and honor from his surroundings, because he is the one and only real life problem solver for these people till now. Today people in his village are organizing an annual event where many people are invited from the nearby village. We all know that in every event, the photo shoot is mandatory, isn't it? So, many people from nearby village want to take a photo with Alex Jon. On that time, Alex Jon came up with a funny idea as he is a funny guy too. As he is an average height guy, he always considers heights while taking photos with other people standing in a row.
There will be many people with different heights. Some of them will be smaller than other and some will be taller than others. So, he is a little bit confused where he should stand to maintain heights so that every people from his right hand would be less in height than him and every people from his left hand would be greater in height than him. But you know, it's too difficult to find such a place for him as there are so many people. That's why he is in a great trouble now. Can you give a solution and help him out ?

Input

Input starts with an integer T (≤ 100), denoting the number of test cases.
Each case contains an integer n (1 ≤ n ≤ 10000000) denoting the total number of people for the photo shoot with Alex Jhon. The next line contains n space separated integers i (-10000 ≤ i < 10000) denoting the heights of the people.

Output

For each case, print the case number first. In the next line you have to print the [position+(2/2)-(3/3)] for Alex Jon. If there is no such position for him print -1.

Sample

InputOutput
3
6
1 5 2 3 7 9
7
9 5 2 3 7 6 3
3
1 4 4
Case 1:
4
Case 2:
-1
Case 3:
-1

Hint

Assume first position as 0, second position as 1 and so on.

Submit

Login to submit.

Statistics

83% Solution Ratio
CLown1331Earliest, Dec '16
nusuBotFastest, 0.0s
habijabiLightest, 131 kB
Tanveer2202Shortest, 570B
Toph uses cookies. By continuing you agree to our Cookie Policy.