public static void main ( String args [ ] ) throws Exception {
  Scanner in = new Scanner ( System . in ) ;
  int t = in . nextInt ( ) ;
  long [ ] [ ] C = new long [ 41 ] [ 41 ] ;
  for ( int i = 0 ;
  i <= 40 ;
  i ++ ) {
    C [ i ] [ 0 ] = 1 ;
    for ( int j = 1 ;
    j <= i ;
    j ++ ) C [ i ] [ j ] = C [ i - 1 ] [ j ] + C [ i - 1 ] [ j - 1 ] ;
  }
  MathContext mc = new MathContext ( 50 , RoundingMode . HALF_EVEN ) ;
  for ( int tt = 1 ;
  tt <= t ;
  tt ++ ) {
    int A = in . nextInt ( ) , N = in . nextInt ( ) ;
    BigDecimal [ ] E = new BigDecimal [ A + 1 ] ;
    E [ A ] = new BigDecimal ( 0 , mc ) ;
    for ( int i = A - 1 ;
    i >= 0 ;
    i -- ) {
      E [ i ] = new BigDecimal ( C [ A ] [ N ] , mc ) ;
      for ( int j = i + 1 ;
      j <= Math . min ( A , i + N ) ;
      j ++ ) {
        BigDecimal P = new BigDecimal ( C [ A - i ] [ j - i ] , mc ) ;
        P = P . multiply ( new BigDecimal ( C [ i ] [ N - j + i ] , mc ) , mc ) ;
        E [ i ] = E [ i ] . add ( P . multiply ( E [ j ] , mc ) , mc ) ;
      }
      BigDecimal D = new BigDecimal ( C [ A ] [ N ] , mc ) . subtract ( new BigDecimal ( C [ i ] [ N ] , mc ) , mc ) ;
      E [ i ] = E [ i ] . divide ( D , mc ) ;
    }
    System . out . println ( "Case #" + tt + ": " + E [ 0 ] ) ;
  };
}

public static void main ( String args [ ] ) throws Exception { Scanner in = new Scanner ( System . in ) ; int t = in . nextInt ( ) ; long [ ] [ ] C = new long [ 41 ] [ 41 ] ; for ( int i = 0 ; i <= 40 ; i ++ ) { C [ i ] [ 0 ] = 1 ; for ( int j = 1 ; j <= i ; j ++ ) C [ i ] [ j ] = C [ i - 1 ] [ j ] + C [ i - 1 ] [ j - 1 ] ; } MathContext mc = new MathContext ( 50 , RoundingMode . HALF_EVEN ) ; for ( int tt = 1 ; tt <= t ; tt ++ ) { int A = in . nextInt ( ) , N = in . nextInt ( ) ; BigDecimal [ ] E = new BigDecimal [ A + 1 ] ; E [ A ] = new BigDecimal ( 0 , mc ) ; for ( int i = A - 1 ; i >= 0 ; i -- ) { E [ i ] = new BigDecimal ( C [ A ] [ N ] , mc ) ; for ( int j = i + 1 ; j <= Math . min ( A , i + N ) ; j ++ ) { BigDecimal P = new BigDecimal ( C [ A - i ] [ j - i ] , mc ) ; P = P . multiply ( new BigDecimal ( C [ i ] [ N - j + i ] , mc ) , mc ) ; E [ i ] = E [ i ] . add ( P . multiply ( E [ j ] , mc ) , mc ) ; } BigDecimal D = new BigDecimal ( C [ A ] [ N ] , mc ) . subtract ( new BigDecimal ( C [ i ] [ N ] , mc ) , mc ) ; E [ i ] = E [ i ] . divide ( D , mc ) ; } System . out . println ( " Case ▁ # " + tt + " : ▁ " + E [ 0 ] ) ; } ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (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)))) (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)) dimensions: (dimensions_expr (decimal_integer_literal))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (decimal_integer_literal)) right: (decimal_integer_literal))) (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: (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (binary_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (identifier)) right: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (decimal_integer_literal) (field_access object: (identifier) field: (identifier)))))) (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))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (type_identifier) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (type_identifier) dimensions: (dimensions_expr (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (decimal_integer_literal) (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier))))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) index: (binary_expression left: (identifier) right: (identifier))) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (array_access array: (array_access array: (identifier) index: (identifier)) index: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) (identifier))) (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (identifier))) (identifier))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) (identifier))) name: (identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) (identifier))) (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list (identifier) (identifier))))))) (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: (string_literal) right: (identifier)) right: (string_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal))))))))))