static void permutation ( int s , int [ ] num ) {
  if ( s == num . length ) {
    int sum = 0 ;
    for ( int i = 0 ;
    i < 4 ;
    i ++ ) {
      for ( int j = i ;
      j < 4 ;
      j += 2 ) {
        sum += a [ num [ j ] ] [ num [ j + 1 ] ] + a [ num [ j + 1 ] ] [ num [ j ] ] ;
      }
    }
    max = Math . max ( max , sum ) ;
    return ;
  }
  for ( int i = s ;
  i < num . length ;
  i ++ ) {
    swap ( num , s , i ) ;
    permutation ( s + 1 , num ) ;
    swap ( num , s , i ) ;
  }
}

static void permutation ( int s , int [ ] num ) { if ( s == num . length ) { int sum = 0 ; for ( int i = 0 ; i < 4 ; i ++ ) { for ( int j = i ; j < 4 ; j += 2 ) { sum += a [ num [ j ] ] [ num [ j + 1 ] ] + a [ num [ j + 1 ] ] [ num [ j ] ] ; } } max = Math . max ( max , sum ) ; return ; } for ( int i = s ; i < num . length ; i ++ ) { swap ( num , s , i ) ; permutation ( s + 1 , num ) ; swap ( num , s , i ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (assignment_expression left: (identifier) right: (decimal_integer_literal)) body: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (array_access array: (array_access array: (identifier) index: (array_access array: (identifier) index: (identifier))) index: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (array_access array: (array_access array: (identifier) index: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))) index: (array_access array: (identifier) index: (identifier)))))))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))) (return_statement))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier))))))))