My code is - https://ide.codingblocks.com/s/197506
My approach is if b>=a then ans will be simply (a*b)
else if (a>b) then I have stored indegree of all nodes in a set. I am finding node with maximum indegree build a temple there and repair roads connected to it. I am able to pass 1 test case in submission. I want to know if this approach is correct or not. If this approach is correct then where I am making a mistake.