~/algor $ cat problems/massiv-x-birinchi-orni
First occurrence of x
Easy
1000 ms
128 MB
27%
A positive integer $n$, an array of $n$ integers and an integer $x$ are given. Determine the position at which the number $x$ occurs in the array for the first time (indices start from $1$; if it is not in the array, print $-1$).
Input
The first line contains a positive integer $n$. The second line contains $n$ integers. The third line contains $x$.
Output
One integer — the position of the first occurrence or $-1$.
Note
$1 \le n \le 10^{4}$
$-1000 \le a_{i}, x \le 1000$
Examples
Input #1
6 4 7 1 7 2 7 7
Output #1
2
Input #2
3 1 2 3 5
Output #2
-1