static boolean calc ( double x ) {
  for ( int i = 0 ;
  i < N ;
  i ++ ) {
    y [ i ] = v [ i ] - w [ i ] * x ;
  }
  Arrays . sort ( y ) ;
  double sum = 0.0 ;
  for ( int i = 0 ;
  i < K ;
  i ++ ) {
    sum += y [ N - i - 1 ] ;
  }
  if ( sum >= 0 ) return true ;
  else return false ;
}

static boolean calc ( double x ) { for ( int i = 0 ; i < N ; i ++ ) { y [ i ] = v [ i ] - w [ i ] * x ; } Arrays . sort ( y ) ; double sum = 0.0 ; for ( int i = 0 ; i < K ; i ++ ) { sum += y [ N - i - 1 ] ; } if ( sum >= 0 ) return true ; else return false ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (floating_point_type) name: (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: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (decimal_floating_point_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: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (return_statement (true)) alternative: (return_statement (false)))))