static long max ( long [ ] a , int teban , long ziro ) {
  long res = Math . abs ( a [ a . length - 1 ] - ziro ) ;
  long key = ziro * 10000 + teban ;
  if ( maxmap . containsKey ( key ) ) return maxmap . get ( key ) ;
  for ( int i = teban ;
  i < a . length - 1 ;
  i ++ ) {
    res = Math . max ( res , min ( a , i + 1 , a [ i ] ) ) ;
  }
  maxmap . put ( key , res ) ;
  return res ;
}

static long max ( long [ ] a , int teban , long ziro ) { long res = Math . abs ( a [ a . length - 1 ] - ziro ) ; long key = ziro * 10000 + teban ; if ( maxmap . containsKey ( key ) ) return maxmap . get ( key ) ; for ( int i = teban ; i < a . length - 1 ; i ++ ) { res = Math . max ( res , min ( a , i + 1 , a [ i ] ) ) ; } maxmap . put ( key , res ) ; return res ; }
(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)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal))) right: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)))) (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) consequence: (return_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: (identifier))) condition: (binary_expression left: (identifier) right: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (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) (binary_expression left: (identifier) right: (decimal_integer_literal)) (array_access array: (identifier) index: (identifier)))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier)))) (return_statement (identifier))))