there are N edges , so + 1 for nodes and + 1 for 1 - based indexing
vector < int > g [ N + 2 ] ; for ( int i = 0 ; i < N ; i ++ ) addEdge ( g , edges [ i ] [ 0 ] , edges [ i ] [ 1 ] ) ; cout << maxProductOfTwoPaths ( g , N ) << endl ; return 0 ; }