Function to print the required number of paths
static void countPairs ( int a , int b ) { int sub = Math . Min ( subtreeSize [ a ] , subtreeSize [ b ] ) ; Console . Write ( sub * ( n - sub ) + " STRNEWLINE " ) ; }