Function for performing DFS and answer to queries
void numberOfNodesUtil ( pair < int , int > Q [ ] , int M , int N ) { vector < vector < int > > adj ( N + 5 ) , levels ( N + 5 ) ; Add_edge ( 1 , 2 , adj ) ; Add_edge ( 1 , 3 , adj ) ; Add_edge ( 2 , 4 , adj ) ; Add_edge ( 2 , 5 , adj ) ; Add_edge ( 2 , 6 , adj ) ; t = 1 ;