Doubt in SPOJ question (Minumum Spanning Tree)

    [Question Link](https://www.spoj.com/problems/MARYBMW/)
    [My solution](https://ideone.com/RYH9nw)

please help me with this question , I’m getting wrong answer on test case 15