*/
class Zheban
{
public static void main(String[] args)
{
int [] arr={1,5,7,19,21,35,45,85};
System.out.println(halfcha(arr,21));
}
public static int halfcha(int[] arr,int key)
{
int min=0,max=arr.length-1,mid;
for (;min<=max ; )
{
mid=(min+max)/2;
if (key<arr[mid])
{
max=mid-1;
}
else if (key>arr[mid])
{
min=mid+1;
}
else
return mid;