Help Needed (Codeforces EDU Binary Search)

Can anyone help me with this question :