Doubt in Wormholes

I submitted a solution to Wormholes.

It failed in 2 testcases, but I am unable to identify the mistake.

Can you please help me by pointing me in the right direction?

Thank you

The problem was - that When all values in V were smaller than the opening of the contest, lower would point to V.end() and that test would be skipped.

This testcase might help-
2 1 1
3 100
4 5
2
6

This is the correct solution-
https://www.codechef.com/viewsolution/38664491