static int maxSquareSubsetSum ( int [ ] A , int N ) {
  int sub1 = 0 , sub2 = 0 ;
  Arrays . sort ( A ) ;
  for ( int i = 0 ;
  i < N ;
  i ++ ) {
    if ( i < ( N / 2 ) - 1 ) sub1 += A [ i ] ;
    else sub2 += A [ i ] ;
  }
  return sub1 * sub1 + sub2 * sub2 ;
}

static int maxSquareSubsetSum ( int [ ] A , int N ) { int sub1 = 0 , sub2 = 0 ; Arrays . sort ( A ) ; for ( int i = 0 ; i < N ; i ++ ) { if ( i < ( N / 2 ) - 1 ) sub1 += A [ i ] ; else sub2 += A [ i ] ; } return sub1 * sub1 + sub2 * sub2 ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) alternative: (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))))) (return_statement (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (identifier) right: (identifier))))))