#CCBCHBAHAI0000111. Odd Gnome
Odd Gnome
Odd Gnome
Source: Kattis
Version: Phuoc Hung OJ Extended
Problem
A lineup contains IDs . Exactly one position , , breaks the consecutive-increasing rule. It is the first position satisfying . Output this 1-based position. The PHOJ adaptation uses one gnome group per input file.
Input
The first line contains . The second line contains the IDs.
Output
Print the 1-based anomalous position.
Subtask
Subtask 1 (20 points): .
Subtask 2 (30 points): .
Subtask 3 (50 points): .
Example
Input
7
10 11 12 99 13 14 15
Output
4
Explanation
is the first value that is not one larger than its predecessor.