according to my logic ans should be 7 for sample test case which is wrong
question link https://hack.codingblocks.com/app/contests/c/969/p/1171
Hint for Pairing graph question
first find no of disconnected component in graph
also find no of nodes in each disconnected component and finally multiply them
ex 5 3 2 // no of nodes=3
0 1 4 // no of nodes=3
these are two disconnected components
ans is 3*3=6
