public static int rec_v2(int i, int j) {
		if(dp[i][j] > 0)
			return dp[i][j];
		
		int ret = 0;
		
		if(i == w.length)
			ret =  0;
		else if(w[i] > j)
			ret = rec_v2(i + 1, j);
		else 
			ret = Math.max(rec_v2(i + 1, j - w[i]) + v[i], rec_v2(i + 1, j));
		
		dp[i][j] = ret;
		return ret;
	}