public static long [ ] solve ( long N , long K ) {
  if ( K == 1 ) {
    long [ ] arr = new long [ 2 ] ;
    arr [ 0 ] = N / 2 ;
    arr [ 1 ] = ( N - 1 ) / 2 ;
    return arr ;
  }
  if ( K % 2 == 0 ) {
    return solve ( N / 2 , K / 2 ) ;
  }
  return solve ( ( N - 1 ) / 2 , K / 2 ) ;
}

public static long [ ] solve ( long N , long K ) { if ( K == 1 ) { long [ ] arr = new long [ 2 ] ; arr [ 0 ] = N / 2 ; arr [ 1 ] = ( N - 1 ) / 2 ; return arr ; } if ( K % 2 == 0 ) { return solve ( N / 2 , K / 2 ) ; } return solve ( ( N - 1 ) / 2 , K / 2 ) ; }
(method_declaration (modifiers) type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (decimal_integer_literal))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)))) (return_statement (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (block (return_statement (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (binary_expression left: (identifier) right: (decimal_integer_literal))))))) (return_statement (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)) (binary_expression left: (identifier) right: (decimal_integer_literal)))))))