public static void main ( String [ ] args ) {
  if ( args . length == 1 ) {
    String filename = "src/main/java/zhang00000/" + args [ 0 ] + ".in" ;
    if ( ! filename . isEmpty ( ) ) try {
      System . setIn ( new FileInputStream ( filename ) ) ;
    }
    catch ( FileNotFoundException e ) {
      System . out . println ( e . getMessage ( ) ) ;
      System . exit ( 1 ) ;
    }
  }
  Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ;
  int t = Integer . valueOf ( in . nextLine ( ) ) ;
  for ( int number = 1 ;
  number <= t ;
  number ++ ) {
    long n = in . nextLong ( ) ;
    long k = in . nextLong ( ) ;
    int d = Long . toBinaryString ( k ) . length ( ) - 1 ;
    long prev = ( n - k + Long . highestOneBit ( k ) ) >> d ;
    long max = prev / 2 ;
    long min = ( prev - 1 ) / 2 ;
    System . out . println ( "Case #" + number + ": " + max + " " + min ) ;
  }
}

public static void main ( String [ ] args ) { if ( args . length == 1 ) { String filename = " src / main / java / zhang00000 / " + args [ 0 ] + " . in " ; if ( ! filename . isEmpty ( ) ) try { System . setIn ( new FileInputStream ( filename ) ) ; } catch ( FileNotFoundException e ) { System . out . println ( e . getMessage ( ) ) ; System . exit ( 1 ) ; } } Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; int t = Integer . valueOf ( in . nextLine ( ) ) ; for ( int number = 1 ; number <= t ; number ++ ) { long n = in . nextLong ( ) ; long k = in . nextLong ( ) ; int d = Long . toBinaryString ( k ) . length ( ) - 1 ; long prev = ( n - k + Long . highestOneBit ( k ) ) >> d ; long max = prev / 2 ; long min = ( prev - 1 ) / 2 ; System . out . println ( " Case ▁ # " + number + " : ▁ " + max + " ▁ " + min ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal))) consequence: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (string_literal) right: (array_access array: (identifier) index: (decimal_integer_literal))) right: (string_literal)))) (if_statement condition: (parenthesized_expression (unary_expression operand: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) consequence: (try_statement body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier))))))) (catch_clause (catch_formal_parameter (catch_type (type_identifier)) name: (identifier)) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (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 (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))) (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal)) right: (identifier)) right: (string_literal)) right: (identifier)))))))))