static double solve ( ) {
  int N = sc . nextInt ( ) ;
  int K = sc . nextInt ( ) ;
  double [ ] Pt = new double [ N ] ;
  for ( int i = 0 ;
  i < N ;
  ++ i ) {
    Pt [ i ] = sc . nextDouble ( ) ;
  }
  Arrays . sort ( Pt ) ;
  double [ ] P = new double [ K ] ;
  double ans = 0 ;
  for ( int u = 0 ;
  u <= K ;
  ++ u ) {
    for ( int i = 0 ;
    i < u ;
    ++ i ) {
      P [ i ] = Pt [ i ] ;
    }
    for ( int i = u ;
    i < K ;
    ++ i ) {
      P [ i ] = Pt [ N - 1 - ( i - u ) ] ;
    }
    double [ ] [ ] dp = new double [ K + 1 ] [ K + 1 ] ;
    dp [ 0 ] [ 0 ] = 1 ;
    for ( int i = 1 ;
    i <= K ;
    ++ i ) {
      for ( int j = 0 ;
      j <= i ;
      ++ j ) {
        if ( j == 0 ) {
          dp [ i ] [ j ] = Math . max ( dp [ i ] [ j ] , dp [ i - 1 ] [ j ] * ( 1 - P [ i - 1 ] ) ) ;
        }
        else {
          dp [ i ] [ j ] = Math . max ( dp [ i ] [ j ] , dp [ i - 1 ] [ j ] * ( 1 - P [ i - 1 ] ) + dp [ i - 1 ] [ j - 1 ] * P [ i - 1 ] ) ;
        }
      }
    }
    ans = Math . max ( ans , dp [ K ] [ K / 2 ] ) ;
  }
  return ans ;
}

static double solve ( ) { int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; double [ ] Pt = new double [ N ] ; for ( int i = 0 ; i < N ; ++ i ) { Pt [ i ] = sc . nextDouble ( ) ; } Arrays . sort ( Pt ) ; double [ ] P = new double [ K ] ; double ans = 0 ; for ( int u = 0 ; u <= K ; ++ u ) { for ( int i = 0 ; i < u ; ++ i ) { P [ i ] = Pt [ i ] ; } for ( int i = u ; i < K ; ++ i ) { P [ i ] = Pt [ N - 1 - ( i - u ) ] ; } double [ ] [ ] dp = new double [ K + 1 ] [ K + 1 ] ; dp [ 0 ] [ 0 ] = 1 ; for ( int i = 1 ; i <= K ; ++ i ) { for ( int j = 0 ; j <= i ; ++ j ) { if ( j == 0 ) { dp [ i ] [ j ] = Math . max ( dp [ i ] [ j ] , dp [ i - 1 ] [ j ] * ( 1 - P [ i - 1 ] ) ) ; } else { dp [ i ] [ j ] = Math . max ( dp [ i ] [ j ] , dp [ i - 1 ] [ j ] * ( 1 - P [ i - 1 ] ) + dp [ i - 1 ] [ j - 1 ] * P [ i - 1 ] ) ; } } } ans = Math . max ( ans , dp [ K ] [ K / 2 ] ) ; } return ans ; }
(method_declaration (modifiers) type: (floating_point_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: (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: (block (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)))) (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))))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_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 (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: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))))) (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 (binary_expression left: (identifier) right: (decimal_integer_literal))) dimensions: (dimensions_expr (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (decimal_integer_literal)) index: (decimal_integer_literal)) right: (decimal_integer_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 (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 (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) (binary_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (identifier)) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))))))))) alternative: (block (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) (binary_expression left: (binary_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (identifier)) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) right: (binary_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))))))))))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (array_access array: (array_access array: (identifier) index: (identifier)) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))))))) (return_statement (identifier))))