my approach–
if cost to build temple <= repairing road then i am building temples in all the cities
and if this is not the case then i am counting no of trees present in forest of graph and then building one temple in each component and then repairing the roads for all the remaining cities…
but it is only passing one test case…