WA in ZCO - Wormholes

Hello ,

I am getting wrong answer in the first subtask of ZCO worm hole problem
Here is my solution : https://www.codechef.com/viewsolution/34481260

Can someone pls help me find a test case for which this is failing ?
pls pls


Failing for first subtask , passed second subtask after i changed my silly mistake
I was declaring table n * n rather than n * 2

Someone pls tell me how to get that 30 points


It has to be going + 1<nv. Also your code is O(n^2) worst case. The testcases are very weak.

Thanks very much @everule1
Yes , I would be doing this problem using lower bound
The test cases are very weak as you said !