Given a sorted array of distinct integers and a target, return the index of the target using binary search, or -1 if it is absent.
Input: line 1 — sorted space-separated integers; line 2 — the target. Output: the 0-based index, or -1.
-1
Your program reads from stdin and prints to stdout.
Example 1
Input: -1 0 3 5 9 12 9
Output: 4
Hints