Driver code
public static void main ( String [ ] args ) { int w [ ] = { 3 , 4 , 5 } ; int val [ ] = { 30 , 50 , 60 } ; int n = w . length ; int C = 8 ; System . out . println ( maxWeight ( w , val , n , C ) ) ; } }