DISTDILEM HELP

question : CodeChef: Practical coding for everyone

My Solution : CodeChef: Practical coding for everyone

I used same logic as in the video but used binary search to find the answer, can anyone help me and find where my code is wrong. Please

Check the following binary-search solution using the std::upper_bound function.

Accepted