My code passes only two test case

Hi Sir/Mam,
my code passes only two test case.,and fail to passes the remaining test case.,when i compiled with custom input it
show correct answer.please see my code and help me in finding my test case,my code_https://ide.codingblocks.com/s/276337

which question you are solving??

is it painter problem??

if yes which logic you have used??

this is completely wrong

you have to use binary search here
Reference Code

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.