static double solve ( int n , int k , double u , double [ ] p ) {
  Arrays . sort ( p ) ;
  while ( u > 0.000000001 ) {
    double min = p [ 0 ] ;
    int ni = n ;
    double np = 1 ;
    for ( int i = 1 ;
    i < n ;
    i ++ ) {
      if ( p [ i ] == min ) {
        continue ;
      }
      np = p [ i ] ;
      ni = i ;
      break ;
    }
    if ( ni * ( np - min ) <= u ) {
      for ( int i = 0 ;
      i < ni ;
      i ++ ) {
        p [ i ] = np ;
      }
      u -= ni * ( np - min ) ;
    }
    else {
      double d = u / ni ;
      for ( int i = 0 ;
      i < ni ;
      i ++ ) {
        p [ i ] += d ;
      }
      u = 0 ;
    }
  }
  double res = 1 ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    res *= p [ i ] ;
  }
  return res ;
}

static double solve ( int n , int k , double u , double [ ] p ) { Arrays . sort ( p ) ; while ( u > 0.000000001 ) { double min = p [ 0 ] ; int ni = n ; double np = 1 ; for ( int i = 1 ; i < n ; i ++ ) { if ( p [ i ] == min ) { continue ; } np = p [ i ] ; ni = i ; break ; } if ( ni * ( np - min ) <= u ) { for ( int i = 0 ; i < ni ; i ++ ) { p [ i ] = np ; } u -= ni * ( np - min ) ; } else { double d = u / ni ; for ( int i = 0 ; i < ni ; i ++ ) { p [ i ] += d ; } u = 0 ; } } double res = 1 ; for ( int i = 0 ; i < n ; i ++ ) { res *= p [ i ] ; } return res ; }
(method_declaration (modifiers) type: (floating_point_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (floating_point_type) name: (identifier)) (formal_parameter type: (array_type element: (floating_point_type) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_floating_point_literal))) body: (block (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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 (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) consequence: (block (continue_statement))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (break_statement))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))) right: (identifier))) consequence: (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: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))) alternative: (block (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (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 (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))))) (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 (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))))) (return_statement (identifier))))