static int getIncome ( int idx ) {
  if ( lists [ idx ] . size ( ) == 0 ) {
    return 1 ;
  }
  int max = 0 ;
  int min = Integer . MAX_VALUE ;
  for ( int x : lists [ idx ] ) {
    int y = getIncome ( x ) ;
    if ( max < y ) {
      max = y ;
    }
    if ( min > y ) {
      min = y ;
    }
  }
  return max + min + 1 ;
}

static int getIncome ( int idx ) { if ( lists [ idx ] . size ( ) == 0 ) { return 1 ; } int max = 0 ; int min = Integer . MAX_VALUE ; for ( int x : lists [ idx ] ) { int y = getIncome ( x ) ; if ( max < y ) { max = y ; } if ( min > y ) { min = y ; } } return max + min + 1 ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) consequence: (block (return_statement (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (array_access array: (identifier) index: (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))))))) (return_statement (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))))