def BINARYSEARCH(arr,key): 
    start = 0 
    end   = len(arr) - 1
    mid   = start + (end -start) // 2 #Mid index of the array
    while( start <= end): 
        if(arr[mid] == key):# Key found at the mid  
            return mid 
        elif(arr[mid] < key): #Key found at right subarray
            start = mid + 1 
        elif(arr[mid] > key): #Key found ar left subarray
            end   = mid - 1
        mid = start + (end - start)//2 
    else: 
        return -1  #Key not found
a = [-43,55,99,188,324] 
c = int(intput("Enter the element to be search for: "))
d = BINARYSEARCH(a,c) 
if(d!=-1): 
    print("Element found at index: ",d)
else: 
    print("Element not found")