ArrayLookup: Array Lookup // Advanced

 
You are given a query integer q and a sorted array of n distinct integers, a[0], a[1], … a[n-1]. The elements in the array will be strictly increasing order. Find the index at which the query appears in the array.

Input Format

The first line has two integers, n and q
The next line will consist of n integers: a[0], a[1], ... a[n-1]

Sample Input

3 2
2 4 6

Output Format

A single integer. If the query is not present in the array, output -1

Sample Output

0




You must be logged in to submit a solution.