Arrays Binary Search

My logic is not run on every test case
code link
https://ide.codingblocks.com/s/340933

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