private void combinationSumHelper(int[] num, int target, int index, 
                        ArrayList<Integer> solution, ArrayList<ArrayList<Integer>> result)
    {
        if (target == 0) {
            result.add(new ArrayList<Integer>(solution));
            return;
        }
        while (index < num.length) {
            for (int i = 0; i < (int)(target / num[i]); i++) {
                combinationSumHelper(num, target - i * num[i], get_next(num, i), solution, result);
            }
        }
    }