List to store tree
static List < List < int [ ] > > graph = new List < List < int [ ] > > ( ) ; static void addEdge ( int u , int v , int cost ) { graph [ u ] . Add ( new int [ ] { v , cost } ) ; graph [ v ] . Add ( new int [ ] { u , cost } ) ; }