public static void solve ( ) {
  int n = in . nextInt ( ) ;
  double [ ] arr = new double [ n ] ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) arr [ i ] = in . nextDouble ( ) ;
  Arrays . sort ( arr ) ;
  if ( arr [ n - 1 ] == 1 ) {
    out . println ( 1. ) ;
    return ;
  }
  double p = 1 - arr [ n - 1 ] ;
  double s = arr [ n - 1 ] / ( 1 - arr [ n - 1 ] ) ;
  for ( int i = n - 2 ;
  i >= 0 ;
  i -- ) {
    if ( s > 1 ) break ;
    p *= 1 - arr [ i ] ;
    s += arr [ i ] / ( 1 - arr [ i ] ) ;
  }
  out . println ( p * s ) ;
}

public static void solve ( ) { int n = in . nextInt ( ) ; double [ ] arr = new double [ n ] ; for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = in . nextDouble ( ) ; Arrays . sort ( arr ) ; if ( arr [ n - 1 ] == 1 ) { out . println ( 1. ) ; return ; } double p = 1 - arr [ n - 1 ] ; double s = arr [ n - 1 ] / ( 1 - arr [ n - 1 ] ) ; for ( int i = n - 2 ; i >= 0 ; i -- ) { if ( s > 1 ) break ; p *= 1 - arr [ i ] ; s += arr [ i ] / ( 1 - arr [ i ] ) ; } out . println ( p * s ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters) 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: (array_type element: (floating_point_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (floating_point_type) 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: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_floating_point_literal)))) (return_statement))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (decimal_integer_literal) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (break_statement)) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (decimal_integer_literal) right: (array_access array: (identifier) index: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (array_access array: (identifier) index: (identifier))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)))))))