public static void main ( String [ ] args ) throws Exception {
  BufferedReader br = new BufferedReader ( new FileReader ( new File ( "in" ) ) ) ;
  BufferedWriter bw = new BufferedWriter ( new FileWriter ( new File ( "out" ) ) ) ;
  StringTokenizer st ;
  int T = Integer . parseInt ( br . readLine ( ) ) ;
  for ( int cn = 1 ;
  cn <= T ;
  cn ++ ) {
    st = new StringTokenizer ( br . readLine ( ) ) ;
    int N = Integer . parseInt ( st . nextToken ( ) ) ;
    int M = Integer . parseInt ( st . nextToken ( ) ) ;
    int K = Integer . parseInt ( st . nextToken ( ) ) ;
    int ans = K ;
    for ( int i = 3 ;
    i <= N ;
    i ++ ) {
      for ( int j = 3 ;
      j <= M ;
      j ++ ) {
        int stones = 2 * ( i - 2 ) + 2 * ( j - 2 ) ;
        int covered = i * j - 4 ;
        if ( K <= covered ) ans = Math . min ( ans , stones ) ;
        for ( int k = 1 ;
        k <= 4 ;
        k ++ ) if ( K <= covered + k ) ans = Math . min ( ans , stones + k ) ;
        if ( i < N || j < M ) if ( K <= covered + 2 ) ans = Math . min ( ans , stones + 1 ) ;
      }
    }
    System . out . println ( N + " " + M + " " + K + " " + ans ) ;
    bw . append ( "Case #" + cn + ": " ) ;
    bw . append ( ans + "\n" ) ;
  }
  bw . flush ( ) ;
}

public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new FileReader ( new File ( " in " ) ) ) ; BufferedWriter bw = new BufferedWriter ( new FileWriter ( new File ( " out " ) ) ) ; StringTokenizer st ; int T = Integer . parseInt ( br . readLine ( ) ) ; for ( int cn = 1 ; cn <= T ; cn ++ ) { st = new StringTokenizer ( br . readLine ( ) ) ; int N = Integer . parseInt ( st . nextToken ( ) ) ; int M = Integer . parseInt ( st . nextToken ( ) ) ; int K = Integer . parseInt ( st . nextToken ( ) ) ; int ans = K ; for ( int i = 3 ; i <= N ; i ++ ) { for ( int j = 3 ; j <= M ; j ++ ) { int stones = 2 * ( i - 2 ) + 2 * ( j - 2 ) ; int covered = i * j - 4 ; if ( K <= covered ) ans = Math . min ( ans , stones ) ; for ( int k = 1 ; k <= 4 ; k ++ ) if ( K <= covered + k ) ans = Math . min ( ans , stones + k ) ; if ( i < N || j < M ) if ( K <= covered + 2 ) ans = Math . min ( ans , stones + 1 ) ; } } System . out . println ( N + " ▁ " + M + " ▁ " + K + " ▁ " + ans ) ; bw . append ( " Case ▁ # " + cn + " : ▁ " ) ; bw . append ( ans + " \n " ) ; } bw . flush ( ) ; }
(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 (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 (object_creation_expression type: (type_identifier) arguments: (argument_list (string_literal))))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (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 (expression_statement (assignment_expression left: (identifier) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (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 (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 (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 (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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 (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: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (binary_expression left: (decimal_integer_literal) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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: (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (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: (decimal_integer_literal)) update: (update_expression (identifier)) body: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) 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: (binary_expression left: (identifier) right: (string_literal)) right: (identifier)) right: (string_literal)) right: (identifier)) right: (string_literal)) right: (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (string_literal))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))