public static int maxWeight(int[] v, int[] w, int capacity){
		int[][] d=new int[v.length+1][capacity+1];
		for(int i=0;i<=v.length;i++){
			for(int j=0;j<=capacity;j++){
				if(i==0){
					d[i][j]=0;
				}else{
					d[i][j]=d[i-1][j];
					if(j>=v[i-1]){
						d[i][j]=Math.max(d[i][j],d[i-1][j-v[i-1]]+w[i-1]);
					}
				}
			}
		}
		
		boolean[] c=new boolean[v.length];
		int tmp=capacity;
		for(int i=v.length;i>0;i--){
			if(d[i][tmp]!=d[i-1][tmp]){
				c[i-1]=true;
				tmp-=v[i-1];
			}
		}
		System.out.println(Arrays.toString(c));
		
		return d[v.length][capacity];
	}