PT07Z wrong answer


#1

This is the link to the question http://www.spoj.com/problems/PT07Z/ . And Link to my solution https://repl.it/@NikhilAgrawal/TanPlumGreatargus .

I am not getting for what case is my answer wrong?


#2

INPUT:

5
1 2
2 3
1 4
4 5

YOUR OUTPUT:
2

CORRECT OUTPUT:
4


#3

In line 51, it should be

if\ (mx < dist*)

instead of

if\ (mx > dist*)

Rest looks correct and should get an AC.


#4

Thanks! Silly mistake, It was!