@@ -0,0 +1,2458 @@
+package org.pilgrim.base;%0Aimport java.util.Arrays;%0Aimport java.util.LinkedList;%0Aimport java.util.Queue;%0A%0Apublic class ChangeMachine%0A%7B%0A    static public int all_comb(int sum,%0A                               int%5B%5D coins,%0A                               Queue%3CInteger%3E queue,%0A                               int st)%0A    %7B%0A        int combsCounter = 0;%0A        if (sum %3C 0) %7B return 0; %7D%0A        if (sum == 0)%0A        %7B%0A            System.out.println(Arrays.toString(queue.toArray()));%0A            return 1;%0A        %7D%0A%0A        for (int i = 0; i %3C coins.length; i++)%0A        %7B%0A            int c = coins%5Bi%5D;%0A            if (st %3E c)%0A            %7B%0A                continue;%0A            %7D%0A            queue.add(c);%0A            combsCounter += all_comb(sum - c, coins, queue, i + 1);%0A            queue.poll();%0A        %7D%0A        return combsCounter;%0A    %7D%0A%0A    public static void main(String%5B%5D args)%0A    %7B%0A        %7B%0A            int%5B%5D coins = %7B 1, 2 %7D;%0A            int combsCounter = all_comb(6, coins, new LinkedList%3CInteger%3E(), coins%5B0%5D);%0A            System.out.println(%22******%22);%0A            System.out.println(combsCounter);%0A            System.out.println(%22======%22);%0A            System.out.println();%0A        %7D%0A        %7B%0A            int%5B%5D coins = %7B 1, 2 %7D;%0A            int combsCounter = all_comb(6, coins, new LinkedList%3CInteger%3E(), coins%5B0%5D);%0A            System.out.println(%22******%22);%0A            System.out.println(combsCounter);%0A            System.out.println(%22======%22);%0A            System.out.println();%0A        %7D%0A        %7B%0A            int%5B%5D coins = %7B 1, 2, 3 %7D;%0A            int combsCounter = all_comb(6, coins, new LinkedList%3CInteger%3E(), coins%5B0%5D);%0A            System.out.println(%22******%22);%0A            System.out.println(combsCounter);%0A            System.out.println(%22======%22);%0A            System.out.println();%0A        %7D%0A        %7B%0A            int%5B%5D coins = %7B 1, 2, 5 %7D;%0A            int combsCounter = all_comb(6, coins, new LinkedList%3CInteger%3E(), coins%5B0%5D);%0A            System.out.println(%22******%22);%0A            System.out.println(combsCounter);%0A            System.out.println(%22======%22);%0A            System.out.println();%0A        %7D%0A        %7B%0A            int%5B%5D coins = %7B 1, 2, 5, 10, 25 %7D;%0A            int combsCounter = all_comb(63, coins, new LinkedList%3CInteger%3E(), coins%5B0%5D);%0A            System.out.println(%22******%22);%0A            System.out.println(combsCounter);%0A            System.out.println(%22======%22);%0A            System.out.println();%0A        %7D%0A    %7D%0A%7D%0A

add Change Machine