static int equalize ( int arr [ ] , int n , int k ) {
  int min_ele = Arrays . stream ( arr ) . min ( ) . getAsInt ( ) ;
  boolean flag = true ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    if ( ! ( ( arr [ i ] + k ) >= min_ele + k && min_ele + k >= ( arr [ i ] - k ) ) ) {
      flag = false ;
      break ;
    }
  }
  if ( flag ) {
    return min_ele + k ;
  }
  else return - 1 ;
}

static int equalize ( int arr [ ] , int n , int k ) { int min_ele = Arrays . stream ( arr ) . min ( ) . getAsInt ( ) ; boolean flag = true ; for ( int i = 0 ; i < n ; i ++ ) { if ( ! ( ( arr [ i ] + k ) >= min_ele + k && min_ele + k >= ( arr [ i ] - k ) ) ) { flag = false ; break ; } } if ( flag ) { return min_ele + k ; } else return - 1 ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (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 (unary_expression operand: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) right: (binary_expression left: (identifier) right: (identifier))) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)))))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (false))) (break_statement))))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (block (return_statement (binary_expression left: (identifier) right: (identifier)))) alternative: (return_statement (unary_expression operand: (decimal_integer_literal))))))