public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  PrintWriter out = new PrintWriter ( System . out ) ;
  int a = sc . nextInt ( ) , b = sc . nextInt ( ) ;
  if ( b > a ) out . println ( - 1 ) ;
  else if ( a == b ) out . println ( a ) ;
  else {
    double r = ( a + b ) / 2.0 ;
    double r2 = ( a - b ) / 2.0 ;
    double k = Math . floor ( ( a + b ) / ( 2.0 * b ) ) ;
    double k2 = Math . floor ( ( a - b ) / ( 2.0 * b ) ) ;
    out . println ( Math . min ( r / k , r2 / k2 ) ) ;
  }
  out . close ( ) ;
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; int a = sc . nextInt ( ) , b = sc . nextInt ( ) ; if ( b > a ) out . println ( - 1 ) ; else if ( a == b ) out . println ( a ) ; else { double r = ( a + b ) / 2.0 ; double r2 = ( a - b ) / 2.0 ; double k = Math . floor ( ( a + b ) / ( 2.0 * b ) ) ; double k2 = Math . floor ( ( a - b ) / ( 2.0 * b ) ) ; out . println ( Math . min ( r / k , r2 / k2 ) ) ; } 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))) 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: (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))) 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: (identifier))) consequence: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (unary_expression operand: (decimal_integer_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) alternative: (block (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_floating_point_literal)))) (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_floating_point_literal)))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (parenthesized_expression (binary_expression left: (decimal_floating_point_literal) right: (identifier)))))))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (parenthesized_expression (binary_expression left: (decimal_floating_point_literal) right: (identifier)))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)) (binary_expression left: (identifier) right: (identifier)))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))