All pastes #742616 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-10-19 17:54 UTC
rendered paste body

    private static long count(int[] a, int limiter, int target) {
        if(limiter == 1) 
            return target % a[0] == 0 ? 1 : 0;

        long c = 0;
        int i;
        for(i = target; i >= 0; i-=a[limiter - 1]) {
            c = c + count(a, limiter - 1, i);
        }
        return c;
    }