Coin Change Problem Enumeration Using N Coins And Each Denomination The coin change problem is very well documented. Given an infinite supply of coins of denominations x_1 to x_m you need to find the number of combinations which add up to y. For example, given x = {1,2,3} and y = 4 we have four combinations:


{1,1,1,1}
{1,1,2}
{1,3}
{2,2}


Introduction

There are several variations of the coin change problem. In this variation  we have two additional restrictions:


Every denomination must be used at least once.
Exactly a fixed number of coins must be used in total.


For example, given x = {1,2,3}, y = 36 and n = 15 where n is the total number of coins that must be used, we get four combinations:


{1,2,2,2,2,2,2,2,3,3,3,3,3,3,3} (1 ones, 7 twos, 7 threes)
{1,1,2,2,2,2,2,3,3,3,3,3,3,3,3} (2 ones, 5 twos, 8 threes)
{1,1,1,2,2,2,3,3,3,3,3,3,3,3,3} (3 ones, 3 twos, 9 threes)
{1,1,1,1,2,3,3,3,3,3,3,3,3,3,3} (4 ones, 1 twos, 10 threes)


Challenge

The challenge is to write a function enumerate in the language of your choice which enumerates all the combinations as described above given:


The list of denominations. For example {1,5,10,25}. You may use either lists or arrays.
A non-negative integer y that denotes the sum of every combination.
A non-negative integer n that denotes the total number of coins.


The order of the arguments doesn't matter. Pointfree functions are allowed.

The output of the enumerate function must be a list of combinations. Each combination must be unique and it must be a list of n integers which add up to y. Every denomination must appear at least once in each combination and no combination must be missing. The ordering of the integers and the combinations doesn't matter. You may use either lists or arrays for the output.

Keep in mind the following edge cases:


If both y and n are zero and the list of denominations is empty then the output is a list of one combination, the empty combination (i.e. {{}}).
Otherwise, if y is zero, n is zero or the list of denominations is empty then the output is a list of zero combinations (i.e. {}).
More generally, if y is less than the sum of the denominations or n is less than the number of denominations then the output is a list of zero combinations.


Scoring will be based on the size of the entire program in bytes. Note that this includes the enumerate function, helper functions, import statements, etc. It does not include test cases.
MATL, 22 bytes

Z^!S!Xu!tsi=Z)"1G@m?@!


Input order is: array of denominations, number of coins taken (n), desired sum (y).

Each combination is displayed on a different line. Empty output is displayed as an empty string (so nothing).

Try it online!

The code runs out of memory in the online compiler for the example in the challenge, but works offline with a standard, reasonably modern computer:

&gt;&gt; matl
 &gt; Z^!S!Xu!tsi=Z)"1G@m?@!
 &gt; 
&gt; [1 2 3]
&gt; 15
&gt; 36
1 1 1 1 2 3 3 3 3 3 3 3 3 3 3
1 1 1 2 2 2 3 3 3 3 3 3 3 3 3
1 1 2 2 2 2 2 3 3 3 3 3 3 3 3
1 2 2 2 2 2 2 2 3 3 3 3 3 3 3


Explanation

Z^      % Implicitly input array of denomminations and number of coins n. Compute 
        % Cartesian power. This gives 2D array with each "combination"
        % on a different row
!S!     % Sort each row
Xu      % Deduplicate rows
!       % Transpose: rows become columns. Call this array A
ts      % Push a copy, compute sum of each column
i       % Input y (desired sum)
=       % Logical array that contains true if the "combination" has the desired sum
Z)      % Keep only those columns in array A
"       % For each column
  1G    %   Push array of denominations again
  @     %   Push current column
  m     %   Is each denomination present in the column?
  ?     %   If so
    @!  %     Push current column again. Transpose into a row
        %   End if
        % End for
        % Implicitly display stack contents