public static void main ( String [ ] args ) throws IOException {
  Scanner in = new Scanner ( new File ( "B.in" ) ) ;
  PrintWriter out = new PrintWriter ( new File ( "B.out" ) ) ;
  int tt = in . nextInt ( ) ;
  for ( int ttt = 1 ;
  ttt <= tt ;
  ttt ++ ) {
    int n = in . nextInt ( ) ;
    int [ ] t = new int [ n ] ;
    for ( int i = 0 ;
    i < n ;
    i ++ ) t [ i ] = in . nextInt ( ) ;
    int res = 0 ;
    if ( n > 0 ) {
      Arrays . sort ( t ) ;
      ArrayList < Niz > nizovi = new ArrayList < B . Niz > ( ) ;
      for ( int i = 0 ;
      i < n ;
      i ++ ) {
        Niz a = null ;
        for ( Niz niz : nizovi ) if ( niz . zadnji == t [ i ] - 1 && ( a == null || a . duzina > niz . duzina ) ) a = niz ;
        if ( a == null ) nizovi . add ( new Niz ( t [ i ] ) ) ;
        else {
          a . duzina ++ ;
          a . zadnji = t [ i ] ;
        }
      }
      res = n ;
      for ( Niz niz : nizovi ) if ( niz . duzina < res ) res = niz . duzina ;
    }
    out . printf ( "Case #%d: %d" , ttt , res ) ;
    out . println ( ) ;
  }
  out . flush ( ) ;
  out . close ( ) ;
  in . close ( ) ;
}

public static void main ( String [ ] args ) throws IOException { Scanner in = new Scanner ( new File ( " B . in " ) ) ; PrintWriter out = new PrintWriter ( new File ( " B . out " ) ) ; int tt = in . nextInt ( ) ; for ( int ttt = 1 ; ttt <= tt ; ttt ++ ) { int n = in . nextInt ( ) ; int [ ] t = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) t [ i ] = in . nextInt ( ) ; int res = 0 ; if ( n > 0 ) { Arrays . sort ( t ) ; ArrayList < Niz > nizovi = new ArrayList < B . Niz > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { Niz a = null ; for ( Niz niz : nizovi ) if ( niz . zadnji == t [ i ] - 1 && ( a == null || a . duzina > niz . duzina ) ) a = niz ; if ( a == null ) nizovi . add ( new Niz ( t [ i ] ) ) ; else { a . duzina ++ ; a . zadnji = t [ i ] ; } } res = n ; for ( Niz niz : nizovi ) if ( niz . duzina < res ) res = niz . duzina ; } out . printf ( " Case ▁ # % d : ▁ % d " , ttt , res ) ; out . println ( ) ; } out . flush ( ) ; out . close ( ) ; in . close ( ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (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 (object_creation_expression type: (type_identifier) arguments: (argument_list (string_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 (string_literal))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (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: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (scoped_type_identifier (type_identifier) (type_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: (type_identifier) declarator: (variable_declarator name: (identifier) value: (null_literal))) (enhanced_for_statement type: (type_identifier) name: (identifier) value: (identifier) body: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) right: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (null_literal)) right: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (field_access object: (identifier) field: (identifier))))))) consequence: (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) consequence: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier))))))) alternative: (block (expression_statement (update_expression (field_access object: (identifier) field: (identifier)))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (array_access array: (identifier) index: (identifier)))))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (enhanced_for_statement type: (type_identifier) name: (identifier) value: (identifier) body: (if_statement condition: (parenthesized_expression (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal) (identifier) (identifier)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))