I am trying to solve this problem on spoj, and i am getting a wrong answer. Here is my code link https://pastebin.com/RXPKuarH .
The problem link is : https://www.spoj.com/problems/MST1/
Getting wrong answer
Output format was different. You need to print the output in the format “Case #tc: ans”
I have made changes in your output format. Your logic was correct.
Edited code : https://ide.codingblocks.com/s/178071
Thank you abhinandan, That is it, my doubt has been resolved