Magical Number
Submissions: 1915   Accuracy:


  Difficulty: Basic   Marks: 1

Your friend loves magic and he has coined a new term - "Magical number". To perform his magic, he needs that Magic number. There are N number of people in the magic show, seated according to their ages in an ascending order. Magical number is that seat no. where the person has the same age as that of the given seat number.
Help your friend in finding out that "Magical number"

The first line of input contains an integer T denoting the number of test cases.
The first line of each test case is N, size of an array.
The second line of each test case contains N input A[].


Print "Magical Number"
Print "-1" when index value does not match with value. 


1 ≤ T ≤ 100
1 ≤ N ≤ 1000
-1000 ≤ A[i] ≤ 1000


-10 -1 0 3 10 11 30 50 100 150


** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Mohit Gupta_OMG :)
Author: Mohit Gupta 4

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Need help with your code? Please use, generate link and share the link here.

to report an issue on this page.