static boolean check ( double target , int K , int n ) {
  myC mc = new myC ( target ) ;
  Arrays . sort ( rec , mc ) ;
  double w = 0 , q = 0 ;
  for ( int i = n - 1 ;
  i >= n - K ;
  i -- ) {
    w += rec [ i ] [ 0 ] ;
    q += rec [ i ] [ 1 ] * rec [ i ] [ 0 ] ;
  }
  return q / w >= target ;
}

static boolean check ( double target , int K , int n ) { myC mc = new myC ( target ) ; Arrays . sort ( rec , mc ) ; double w = 0 , q = 0 ; for ( int i = n - 1 ; i >= n - K ; i -- ) { w += rec [ i ] [ 0 ] ; q += rec [ i ] [ 1 ] * rec [ i ] [ 0 ] ; } return q / w >= target ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (floating_point_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) 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 (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier)))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (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: (binary_expression left: (identifier) right: (identifier))) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (array_access array: (array_access array: (identifier) index: (identifier)) index: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (decimal_integer_literal)) right: (array_access array: (array_access array: (identifier) index: (identifier)) index: (decimal_integer_literal))))))) (return_statement (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)))))