Snackdown elimination round

Problem MAXDIST have very weak input. It even passes the wrong solution. Solution id http://www.codechef.com/viewsolution/7251982 is giving wrong answer on testcase

1

9

1 2

2 3

3 4

4 5

4 6

4 7

2 9

2 8

I checked this testcase on solution id http://www.codechef.com/viewsolution/7251982 and http://www.codechef.com/viewsolution/7200243. 2nd one is giving correct answer i.e “YES” but first one is giving ans “NO”.
Please check it and if i am wrong reply in comments.

Even http://www.codechef.com/viewsolution/7197166 of team fast_match is giving wrong answer on this input