Function to add edges
static void addedge ( int a , int b ) { if ( ! tree . ContainsKey ( a ) ) tree [ a ] = new List < int > ( ) ; tree [ a ] . Add ( b ) ; if ( ! tree . ContainsKey ( b ) ) tree [ b ] = new List < int > ( ) ; tree [ b ] . Add ( a ) ; } static void FindCenter ( int n ) {