public static void SubsetSum(int target, int[] subsets){
		int n = subsets.length;
		table V = new table(n+1,target+1);
		//bottom up manner
		for(int i = 0; i <= n; i++){
			for(int w = 0; w <= target; w++){
				if(i == 0 || w == 0) {
					V.set(i,w,0);
				} else if(subsets[i-1] <= w) {
					int a = subsets[i-1] + V.get(i-1,w-subsets[i-1]);
					int b = V.get(i-1,w);
					V.set(i,w,max(a,b));
					if(max(a,b) == a){
						V.setcurrent(i, w, subsets[i-1]);
						V.setprevious(i, w, V.getNode(i-1,w-subsets[i-1]));
					} else {
						V.setprevious(i,w,V.getNode(i-1,w));
					}
				} else {
					//this is the case "2 3 4 5", 6: the last i, 5 is not going to be used
					V.set(i,w,V.get(i-1, w));
					V.setprevious(i,w,V.getNode(i-1,w));
				}
			}
		}
		if(V.get(n,target) != target){
			System.out.println("No combination matches");
		} else {
			table.Node last = V.getNode(n, target);
			while(last != null){
				if(last.current != -1)
					System.out.print(last.current+" ");
				last = last.previous;
			}
		}
	}