public static void main ( String [ ] args ) throws FileNotFoundException {
  Scanner scan = new Scanner ( System . in ) ;
  BigInteger TWO = BigInteger . valueOf ( 2 ) ;
  BigInteger FOUR = BigInteger . valueOf ( 4 ) ;
  int cases = scan . nextInt ( ) ;
  BigInteger r , t , res ;
  PrintStream outfile = new PrintStream ( "C-large.out.txt" ) ;
  for ( int c = 1 ;
  c <= cases ;
  c ++ ) {
    r = scan . nextBigInteger ( ) ;
    t = scan . nextBigInteger ( ) ;
    res = r . multiply ( r ) . subtract ( r ) ;
    res = res . add ( t . multiply ( TWO ) ) ;
    res = res . multiply ( FOUR ) . add ( BigInteger . ONE ) ;
    res = bigIntSqRootFloor ( res ) ;
    res = res . subtract ( r . mod ( TWO ) . equals ( BigInteger . ZERO ) ? BigInteger . valueOf ( 3 ) : BigInteger . valueOf ( 5 ) ) ;
    res = res . divide ( FOUR ) ;
    res = res . subtract ( r . divide ( TWO ) ) . add ( BigInteger . ONE ) ;
    outfile . println ( "Case #" + c + ": " + res . toString ( ) ) ;
  }
}

public static void main ( String [ ] args ) throws FileNotFoundException { Scanner scan = new Scanner ( System . in ) ; BigInteger TWO = BigInteger . valueOf ( 2 ) ; BigInteger FOUR = BigInteger . valueOf ( 4 ) ; int cases = scan . nextInt ( ) ; BigInteger r , t , res ; PrintStream outfile = new PrintStream ( " C - large . out . txt " ) ; for ( int c = 1 ; c <= cases ; c ++ ) { r = scan . nextBigInteger ( ) ; t = scan . nextBigInteger ( ) ; res = r . multiply ( r ) . subtract ( r ) ; res = res . add ( t . multiply ( TWO ) ) ; res = res . multiply ( FOUR ) . add ( BigInteger . ONE ) ; res = bigIntSqRootFloor ( res ) ; res = res . subtract ( r . mod ( TWO ) . equals ( BigInteger . ZERO ) ? BigInteger . valueOf ( 3 ) : BigInteger . valueOf ( 5 ) ) ; res = res . divide ( FOUR ) ; res = res . subtract ( r . divide ( TWO ) ) . add ( BigInteger . ONE ) ; outfile . println ( " Case ▁ # " + c + " : ▁ " + res . toString ( ) ) ; } }
(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 (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (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: (type_identifier) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (string_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 (expression_statement (assignment_expression left: (identifier) right: (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)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list (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 (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (ternary_expression condition: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))) consequence: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) alternative: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))))))))