static void pack ( int s , int g , HashMap < Integer , Integer > map , int W ) {
  if ( s == g ) {
    if ( map . containsKey ( W ) ) {
      map . put ( W , map . get ( W ) + 1 ) ;
    }
    else {
      map . put ( W , 1 ) ;
    }
  }
  else {
    pack ( s + 1 , g , map , W ) ;
    pack ( s + 1 , g , map , W + w [ s ] ) ;
  }
}

static void pack ( int s , int g , HashMap < Integer , Integer > map , int W ) { if ( s == g ) { if ( map . containsKey ( W ) ) { map . put ( W , map . get ( W ) + 1 ) ; } else { map . put ( W , 1 ) ; } } else { pack ( s + 1 , g , map , W ) ; pack ( s + 1 , g , map , W + w [ s ] ) ; } }
(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)) (formal_parameter type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (decimal_integer_literal)))))) alternative: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal))))))) alternative: (block (expression_statement (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier) (identifier) (identifier)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier) (identifier) (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))))))))