My code is exceeding required timelimit


help me fixing it.

can anybody tell me why my code is exceeding timelimit even if i am using binary search method to solve this problem,