private static long solve ( long n , long s ) {
  long k ;
  for ( k = 2 ;
  k * k <= n || k < 100 ;
  k ++ ) {
    if ( split ( n , k ) == s ) {
      return k ;
    }
  }
  while ( k <= n ) {
    long a = n / k ;
    long b = n % k ;
    if ( ( a + b - s ) % a == 0 ) {
      long dk = ( a + b - s ) / a ;
      if ( dk >= 0 && b - dk * a >= 0 ) {
        return k + dk ;
      }
    }
    k = n / a + 1 ;
  }
  if ( n == s ) {
    return n + 1 ;
  }
  return - 1 ;
}

private static long solve ( long n , long s ) { long k ; for ( k = 2 ; k * k <= n || k < 100 ; k ++ ) { if ( split ( n , k ) == s ) { return k ; } } while ( k <= n ) { long a = n / k ; long b = n % k ; if ( ( a + b - s ) % a == 0 ) { long dk = ( a + b - s ) / a ; if ( dk >= 0 && b - dk * a >= 0 ) { return k + dk ; } } k = n / a + 1 ; } if ( n == s ) { return n + 1 ; } return - 1 ; }
(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))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))) right: (identifier))) consequence: (block (return_statement (identifier)))))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) right: (identifier)) right: (decimal_integer_literal))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal)))) consequence: (block (return_statement (binary_expression left: (identifier) right: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (return_statement (binary_expression left: (identifier) right: (decimal_integer_literal))))) (return_statement (unary_expression operand: (decimal_integer_literal)))))