static void dfs ( int u , int p ) {
  if ( u == 0 ) ans [ u ] = 1 ;
  else ans [ u ] = ans [ p ] + 0.5 * ( 1 + cnt [ p ] - cnt [ u ] ) ;
  for ( int v : adjList [ u ] ) dfs ( v , u ) ;
}

static void dfs ( int u , int p ) { if ( u == 0 ) ans [ u ] = 1 ; else ans [ u ] = ans [ p ] + 0.5 * ( 1 + cnt [ p ] - cnt [ u ] ) ; for ( int v : adjList [ u ] ) dfs ( v , u ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) alternative: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (decimal_floating_point_literal) right: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (array_access array: (identifier) index: (identifier))) right: (array_access array: (identifier) index: (identifier))))))))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (array_access array: (identifier) index: (identifier)) body: (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier)))))))