Class to represent Disjoint Set Data structure
class DisjointUnionSets { vector < int > rank , parent ; int n ; public : DisjointUnionSets ( int n ) { rank . resize ( n ) ; parent . resize ( n ) ; this -> n = n ; makeSet ( ) ; } void makeSet ( ) {