Why im failing in test cases

import java.util.Scanner;

public class Main{

public static Scanner s=new Scanner(System.in);
public static void main(String[] args)
{
     int [] array=takeinput();
     System.out.println(Index(array));
}
public static int []  takeinput(){
    int n=s.nextInt();
    int [] arr=new int[n];
    for(int i=0;i<n;i++)
    {
        arr[i]=s.nextInt();
    }
    return arr;
}

public static int Index(int [] arr)
{
    int m=s.nextInt();
    int low=0;
    int high=arr.length-1;
    while(low<=high){
		int mid=(low+high)/2;
    if(arr[mid]>m)
    {
        low=mid+1;
    }
    else if (arr[mid]<m)
    {
        high=mid-1;
    }
    else{
        return mid;
    }

 }
 return -1;

}

}

https://ide.codingblocks.com/s/429244 sir u can see the code

try to debug for this input :
5
3
5
6
9
78
3
correct output : 0
your code Gives -1