Taking edges as input and put them in adjacency list representation
for ( i = 0 ; i < q ; i ++ ) { int x , y ; x = e [ i ] . u , y = e [ i ] . v ; v [ x ] . push_back ( y ) ; v [ y ] . push_back ( x ) ; }