public static void main ( String [ ] args ) throws IOException {
  Scanner in = new Scanner ( new File ( "hotDog.in" ) ) ;
  PrintWriter out = new PrintWriter ( new File ( "hotDog.out" ) ) ;
  int tt = in . nextInt ( ) ;
  for ( int t = 1 ;
  t <= tt ;
  t ++ ) {
    System . out . println ( t ) ;
    int c = in . nextInt ( ) ;
    double d = in . nextInt ( ) ;
    Point [ ] p = new Point [ c ] ;
    for ( int i = 0 ;
    i < c ;
    i ++ ) {
      int position = in . nextInt ( ) ;
      int total = in . nextInt ( ) ;
      p [ i ] = new Point ( position , total ) ;
    }
    double lg = 0 , dg = 1000000000 ;
    dg *= dg ;
    int count = 0 ;
    while ( dg - lg > eps && count < 100000 ) {
      count ++ ;
      double s = ( dg + lg ) / 2 ;
      boolean moze = true ;
      double tmin = - 1000000000000000000.0 ;
      for ( int i = 0 ;
      moze && i < c ;
      i ++ ) {
        double t1 = Math . max ( tmin , p [ i ] . position - s ) ;
        double tlast = t1 + ( double ) ( p [ i ] . total - 1 ) * ( double ) d ;
        if ( tlast - p [ i ] . position > s + eps ) moze = false ;
        else tmin = tlast + ( double ) d ;
      }
      if ( moze ) dg = s ;
      else lg = s ;
    }
    System . out . println ( dg + " " + lg ) ;
    out . printf ( "Case #%d: %.10f" , t , ( lg + dg ) / 2 ) ;
    out . println ( ) ;
  }
  out . flush ( ) ;
  out . close ( ) ;
}

public static void main ( String [ ] args ) throws IOException { Scanner in = new Scanner ( new File ( " hotDog . in " ) ) ; PrintWriter out = new PrintWriter ( new File ( " hotDog . out " ) ) ; int tt = in . nextInt ( ) ; for ( int t = 1 ; t <= tt ; t ++ ) { System . out . println ( t ) ; int c = in . nextInt ( ) ; double d = in . nextInt ( ) ; Point [ ] p = new Point [ c ] ; for ( int i = 0 ; i < c ; i ++ ) { int position = in . nextInt ( ) ; int total = in . nextInt ( ) ; p [ i ] = new Point ( position , total ) ; } double lg = 0 , dg = 1000000000 ; dg *= dg ; int count = 0 ; while ( dg - lg > eps && count < 100000 ) { count ++ ; double s = ( dg + lg ) / 2 ; boolean moze = true ; double tmin = - 1000000000000000000.0 ; for ( int i = 0 ; moze && i < c ; i ++ ) { double t1 = Math . max ( tmin , p [ i ] . position - s ) ; double tlast = t1 + ( double ) ( p [ i ] . total - 1 ) * ( double ) d ; if ( tlast - p [ i ] . position > s + eps ) moze = false ; else tmin = tlast + ( double ) d ; } if ( moze ) dg = s ; else lg = s ; } System . out . println ( dg + " ▁ " + lg ) ; out . printf ( " Case ▁ # % d : ▁ % .10f " , t , ( lg + dg ) / 2 ) ; out . println ( ) ; } out . flush ( ) ; out . 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 (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (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: (floating_point_type) 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 (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)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier) (identifier))))))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) body: (block (expression_statement (update_expression (identifier))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal)))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_floating_point_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: (binary_expression left: (identifier) right: (identifier))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier)) right: (identifier)))))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (binary_expression left: (cast_expression type: (floating_point_type) value: (parenthesized_expression (binary_expression left: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier)) right: (decimal_integer_literal)))) right: (cast_expression type: (floating_point_type) value: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier))) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (false))) alternative: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (cast_expression type: (floating_point_type) value: (identifier)))))))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (expression_statement (assignment_expression left: (identifier) right: (identifier))) alternative: (expression_statement (assignment_expression left: (identifier) right: (identifier)))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal) (identifier) (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal))))) (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)))))