Hi,

This is my code for the chefres problem. I initially sorted the L and R arrays. Later for each test case, I tried to find the greatest L[i] lower than or equal to the given time using a modified binary search. But my solution for subtask 2 is evaluated as “WA”(For subtask 1, it is accepting the solution). I tried to find the issue but am not able. Can anyone kindly find the issue with the code?

https://www.codechef.com/viewsolution/20406821

Thanks,

Sundeep