public static void main ( String args [ ] ) throws IOException {
  BufferedReader in = new BufferedReader ( new FileReader ( "C-large.in" ) ) ;
  PrintWriter out = new PrintWriter ( new BufferedWriter ( new FileWriter ( "C.out" ) ) ) ;
  long alow , ahigh , blow , bhigh , cases ;
  cases = Integer . parseInt ( in . readLine ( ) ) ;
  double gold = ( 1 + Math . sqrt ( 5 ) ) / 2 ;
  for ( int i = 1 ;
  i <= cases ;
  i ++ ) {
    StringTokenizer st = new StringTokenizer ( in . readLine ( ) ) ;
    alow = Integer . parseInt ( st . nextToken ( ) ) ;
    ahigh = Integer . parseInt ( st . nextToken ( ) ) ;
    blow = Integer . parseInt ( st . nextToken ( ) ) ;
    bhigh = Integer . parseInt ( st . nextToken ( ) ) ;
    long count = ( ahigh - alow + 1 ) * ( bhigh - blow + 1 ) ;
    for ( long a = alow ;
    a <= ahigh ;
    a ++ ) {
      long low = Math . max ( ( long ) ( a / gold + 1 ) , blow ) ;
      long high = Math . min ( bhigh , ( long ) ( a * gold ) ) ;
      if ( low <= bhigh && high >= blow ) count -= high - low + 1 ;
    }
    out . println ( "Case #" + i + ": " + count ) ;
  }
  out . close ( ) ;
}

public static void main ( String args [ ] ) throws IOException { BufferedReader in = new BufferedReader ( new FileReader ( " C - large . in " ) ) ; PrintWriter out = new PrintWriter ( new BufferedWriter ( new FileWriter ( " C . out " ) ) ) ; long alow , ahigh , blow , bhigh , cases ; cases = Integer . parseInt ( in . readLine ( ) ) ; double gold = ( 1 + Math . sqrt ( 5 ) ) / 2 ; for ( int i = 1 ; i <= cases ; i ++ ) { StringTokenizer st = new StringTokenizer ( in . readLine ( ) ) ; alow = Integer . parseInt ( st . nextToken ( ) ) ; ahigh = Integer . parseInt ( st . nextToken ( ) ) ; blow = Integer . parseInt ( st . nextToken ( ) ) ; bhigh = Integer . parseInt ( st . nextToken ( ) ) ; long count = ( ahigh - alow + 1 ) * ( bhigh - blow + 1 ) ; for ( long a = alow ; a <= ahigh ; a ++ ) { long low = Math . max ( ( long ) ( a / gold + 1 ) , blow ) ; long high = Math . min ( bhigh , ( long ) ( a * gold ) ) ; if ( low <= bhigh && high >= blow ) count -= high - low + 1 ; } out . println ( " Case ▁ # " + i + " : ▁ " + count ) ; } out . close ( ) ; }
(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 (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: (integral_type) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (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: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (expression_statement (assignment_expression left: (identifier) right: (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: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) right: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) 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 (cast_expression type: (integral_type) value: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))) (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (cast_expression type: (integral_type) value: (parenthesized_expression (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: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal)) right: (identifier))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))