static int maxRectangle ( int R , int C , int A [ ] [ ] ) {
  int result = maxHist ( R , C , A [ 0 ] ) ;
  for ( int i = 1 ;
  i < R ;
  i ++ ) {
    for ( int j = 0 ;
    j < C ;
    j ++ ) if ( A [ i ] [ j ] == 1 ) A [ i ] [ j ] += A [ i - 1 ] [ j ] ;
    result = Math . max ( result , maxHist ( R , C , A [ i ] ) ) ;
  }
  return result ;
}

static int maxRectangle ( int R , int C , int A [ ] [ ] ) { int result = maxHist ( R , C , A [ 0 ] ) ; for ( int i = 1 ; i < R ; i ++ ) { for ( int j = 0 ; j < C ; j ++ ) if ( A [ i ] [ j ] == 1 ) A [ i ] [ j ] += A [ i - 1 ] [ j ] ; result = Math . max ( result , maxHist ( R , C , A [ i ] ) ) ; } return result ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (array_access array: (identifier) index: (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: (identifier)) update: (update_expression (identifier)) body: (block (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: (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (decimal_integer_literal))) consequence: (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (array_access array: (identifier) index: (identifier)))))))))) (return_statement (identifier))))