Only test case 2 is passing

code: https://ide.codingblocks.com/s/197247

Algorithm:
i am making connected components
then cost of building temple is less then simply build a temple in each node
else

eg. if( a component has 5 nodes => 1 of them has a temple made rest 4 will incur cost of road repair)
for no of independ component build 1 temple in each component
in the edgesInConnectedComponent vector i am storing the no of nodes each connected component has
so multiply the cost of road repair with no of nodes in each connected component

refer the code to get a better understanding