public static long possibilities ( long str , long intel , long exp ) {
  if ( str + exp <= intel ) return 0 ;
  if ( intel >= str ) {
    exp -= intel - str + 1 ;
    str = intel + 1 ;
  }
  long difference = exp - intel + str ;
  long possibilities = ( long ) Math . min ( exp + 1 , difference / 2 + difference % 2 ) ;
  return possibilities ;
}

public static long possibilities ( long str , long intel , long exp ) { if ( str + exp <= intel ) return 0 ; if ( intel >= str ) { exp -= intel - str + 1 ; str = intel + 1 ; } long difference = exp - intel + str ; long possibilities = ( long ) Math . min ( exp + 1 , difference / 2 + difference % 2 ) ; return possibilities ; }
(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))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) consequence: (return_statement (decimal_integer_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))))))) (return_statement (identifier))))