Under construction

Still being built. Things may change

Odd Gnome

Time limit2sMemory limit512 MB

Summary
For each group of unique IDs whose non-king elements increase by exactly one, output the 1-based position of the single out-of-order gnome.
Level

Easy3 of 10

Topics
Array, Implementation
Solved
No attempts yet

Problem

According to legend, gnomes live underground in burrows called gnome holes. They dig up and eat the roots of plants there, and they leave small heaps of earth around gardens, which does real damage.

Mrs. W is tired of the damage, so she clears her garden of gnomes regularly by throwing them over the fence. Throwing them one at a time is far too much work because there are so many. Luckily this species follows its king no matter what, so if she throws only the king over the fence, every other gnome in that group leaves with him.

How does Mrs. W spot the king in a group of gnomes? She knows that gnomes line up in a fixed order, and the king, being special, is the only gnome who breaks that order.

A group of gnomes has these properties.

  • Each group holds exactly one king.
  • Apart from the king, the gnomes line up in strictly increasing order of ID.
  • The king is the only gnome out of that order.
  • The king likes to hide, so he never stands first or last in the group.

Help Mrs. W find every king.

Input

The first line holds the number of gnome groups nn (1≤n≤1001 \le n \le 100). Each of the next nn lines describes one group. The line starts with the number of gnomes in that group, gg (3≤g≤10003 \le g \le 1000), followed on the same line by gg space separated IDs in the order the gnomes stand. Within a group every ID, the king's included, is distinct, and each value is between 00 and 1000010000. Excluding the king, each ID is exactly 11 larger than the ID before it.

Output

For each group, print the position of the king in that group on its own line. The gnome standing first in line is at position 11.

Examples3

  1. Example 1

    Input
    3
    7 1 2 3 4 8 5 6
    5 3 4 5 2 6
    4 10 20 11 12
    
    Expected output
    5
    4
    2
    
  2. Example 2

    Input
    1
    3 0 2 1
    
    Expected output
    2
    
  3. Example 3

    Input
    2
    6 5 4 6 7 8 9
    6 5 6 7 8 11 9
    
    Expected output
    2
    5