public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  int T = sc . nextInt ( ) ;
  for ( int C = 1 ;
  C <= T ;
  C ++ ) {
    System . out . printf ( "Case #%d:\n" , C ) ;
    double D = sc . nextDouble ( ) ;
    int N = sc . nextInt ( ) ;
    int A = sc . nextInt ( ) ;
    if ( N == 1 ) {
      sc . nextDouble ( ) ;
      sc . nextDouble ( ) ;
      for ( int i = 0 ;
      i < A ;
      i ++ ) {
        double a = sc . nextDouble ( ) ;
        System . out . println ( Math . sqrt ( 2 * D / a ) ) ;
      }
      continue ;
    }
    double t1 = sc . nextDouble ( ) ;
    double d1 = sc . nextDouble ( ) ;
    double t2 = sc . nextDouble ( ) ;
    double d2 = sc . nextDouble ( ) ;
    double v = ( d2 - d1 ) / t2 ;
    for ( int i = 0 ;
    i < A ;
    i ++ ) {
      double a = sc . nextDouble ( ) ;
      double t_meet = ( v + Math . sqrt ( v * v + 2 * a * d1 ) ) / a ;
      double d_meet = d1 + v * t_meet ;
      if ( d_meet >= D ) {
        System . out . println ( Math . sqrt ( 2 * D / a ) ) ;
      }
      else {
        System . out . println ( t_meet + ( D - d_meet ) / v ) ;
      }
    }
  }
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int T = sc . nextInt ( ) ; for ( int C = 1 ; C <= T ; C ++ ) { System . out . printf ( " Case ▁ # % d : \n " , C ) ; double D = sc . nextDouble ( ) ; int N = sc . nextInt ( ) ; int A = sc . nextInt ( ) ; if ( N == 1 ) { sc . nextDouble ( ) ; sc . nextDouble ( ) ; for ( int i = 0 ; i < A ; i ++ ) { double a = sc . nextDouble ( ) ; System . out . println ( Math . sqrt ( 2 * D / a ) ) ; } continue ; } double t1 = sc . nextDouble ( ) ; double d1 = sc . nextDouble ( ) ; double t2 = sc . nextDouble ( ) ; double d2 = sc . nextDouble ( ) ; double v = ( d2 - d1 ) / t2 ; for ( int i = 0 ; i < A ; i ++ ) { double a = sc . nextDouble ( ) ; double t_meet = ( v + Math . sqrt ( v * v + 2 * a * d1 ) ) / a ; double d_meet = d1 + v * t_meet ; if ( d_meet >= D ) { System . out . println ( Math . sqrt ( 2 * D / a ) ) ; } else { System . out . println ( t_meet + ( D - d_meet ) / v ) ; } } } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (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: (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 (string_literal) (identifier)))) (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: (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)))) (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))) (expression_statement (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: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (identifier))))))))) (continue_statement))) (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: (floating_point_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: (floating_point_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: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (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: (floating_point_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: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (identifier))))))) right: (identifier)))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (identifier)))))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier))))))))))))))