static int maxWeight ( int w [ ] , int val [ ] , int n , int c ) {
  for ( int i = V_SUM_MAX ;
  i >= 0 ;
  i -- ) {
    if ( solveDp ( i , 0 , w , val , n ) <= c ) {
      return i ;
    }
  }
  return 0 ;
}

static int maxWeight ( int w [ ] , int val [ ] , int n , int c ) { for ( int i = V_SUM_MAX ; i >= 0 ; i -- ) { if ( solveDp ( i , 0 , w , val , n ) <= c ) { return i ; } } return 0 ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal) (identifier) (identifier) (identifier))) right: (identifier))) consequence: (block (return_statement (identifier)))))) (return_statement (decimal_integer_literal))))