[Question]
  [
# Task
Given a set of `n` unique elements and a multiset `l` of positive numbers that add up to `n`, find all the ways of partitioning those unique elements into disjoint sets with sizes given by the elements of `l`.
(A multiset is a set that allows repeated elements)
The point here is that we are taking everything in the output as sets, so order doesn't matter in any place.
This may be simpler to understand if you check some test cases below.
# Input
The multiset `l` of positive integers that add up to `n`. Note that the elements in `l` may appear repeatedly. This might be given as
* a list `l = [1, 1, 2, 2, 3]`
* arguments to a function `f(1, 1, 2, 2, 3)`
* or any other sensible way of representing a multiset
You may assume the representation of `l` is ordered.
You may also take a list/set/collection of `n` distinct integers, or you may generate it depending on the sum of the elements in `l`. If you generate it, you may use *any* `n` distinct integers for the set to be partitioned but your remaining code should work for any set of `n` integers. The set you use must be specified in your answer. Suggestions include:
* a range starting in `0`: `[0, 1, ..., n-1]`
* a range starting in `1`: `[1, 2, ..., n]`
# Output
The different ways in which your collection can be split in sets with the given sizes. Your output should be unambiguous.
# Reference implementation
You can find a [vanilla python reference implementation here](https://gist.github.com/RojerGS/a2c41c4d4bd3a1fe3c5af52910a73e61) or [you can try it online](https://tio.run/##pVbbbuM2EH3XVwych0obxV0nfSgMZH9hgaJAH7yCI1vjmI1EaklqXbfYb09nOKQkO3lYtEFgXTgzPHM5h@rP/mj0w@trgwfYH41xmDv0JehinQEsFovf6xd0UEOrnAdzgEGrrwMCttih9rSiG7DoB6vpvm3BHxF645zatUgRTvXZsVuIrfQz6Mn1YE0HijarHZyQfOlK7uRlsauVbtCyK0ckTHStPcVzoI3neA71kgBmZK8OFPfxET6CsXT3CVrUnEdIAiI@2FRse0OP@8E69Q1hVzuEPf2UvItFUARWt2f6QYYO3kBjCCP5YZt2WcWo8Mgh@fYGerV/CUhjdiXgN7RUXc4ZW9rm2VAdBz04bILPgaCqMtiDoqrooUNbe5zhpj2Wdd@jbvJ8w4ZVyZXYrFV1y1d1u1pXRTHP0WYBqkOJcMS6IZhs/FGg7kxzjm/IOYvwUXH@QOBCEuxWci0bo3/yy2gk8xEMpEGhn0O3kz5d9pWteK/ge6Lw24glThmv0ZjdrYp5NXJaVXtqR4sHX1zWZQwyVmd8s1EVRc43fF/dXsSI2E@GDP4g@8@DF0jmfUA/DsdcgTFzKMkxQpqgxD5NFblNnmE5y5iJrm@VFyLuj4N@2Tr1N/5XRpKJ8o58@9p65ZXRgZH4daDVM3DoRrZxJZwCDbh5xk78I@fdsH/BGH1aVtqpRuzFQCYGutp7tMxOSonrP41JDERviUwUwOeJrD/PchW/a8ZFHm/IuqqyRMrJ7T1bIU7oaOKauEdkJ4au2gaw3h9TFspzk0ki2nMwYu86LhIHPVUSdmc4qL@YA6wWUuWxC8GLyqLhSebraVTHiTvk50SSnDeWmtrXyobm5KnczsChtuXUXZ4kliWiKhcpiFC@EWEoOCmNp22UpiwOMudsa/2MuY7jyq9ZiUj3zJZZzxZpkm/oSfl5U3law/OB8PmoYglT9OJ9w2vaWoKS5FRjyHfFQw4KRcOu0EVTYY6biBmDkVrN2ZCEg2NL/1J9pwFLmc5ZzJnGLVK@QK6WCHhO@MPlFjYppago1WgfajxK89w7SkUxnhDBdLNei/OsOYHtjL5Rbl9bKmfXe6Ij7g1RrMNRVnkseTCyaahHJof0xqcStqGR1PkgIxPhRUv42SUZ@U1ipaqFg5rmKkjPeOa@lZeAmzZJAxpGo7d4RxsqTXXj5rilHCyfZxpyoSCiHuzLmjojXkOn5CQgS4EqHHm2ZuhlgAaRMFd3eCf6NTU9JLl0xvq8EG7VdNL/ALNkqgOp0A2td@9Ta1oLBDsdVYuy6Tqbj2PaJ2RP3xWMUyzYOMqVOKaz@SbURtyDT1frczzIzWnLT8lluTcDSecYqhgjuzFq8knH/Lukl3Qm6l9/yDj57no2LNVmFMFQfk7hJXrSKtoOG0Vn4zV3yxH@hyvA7/NzHmsiqVQnzSeLyQgxQHvLfRBrroicqGmjNygERzDa2nBEBMdp83QICBvj922qRU2Pz1o@@4a@4QpclCMWeRZsJpZRbOLeVzbRM0nNbBUgT0HmXzrylz410qjOQl1K0XyY/48ghSSm@drORqt69ej8lr@yw0bktVlVH34t@eahCpf7Elbj3b3crehu/no1rtyHlQuzh/GB/n@pMpr4P43S2x0TZvFFc26LrLf8ubF4enpaFBmjZWQMdUK4jmfqTDr5OyuX49MNXc62RVGUwYkLLVEPi3/4xXe4@wSbuCG1lV5HIEu@5l3d586T7Nii@P5FV4spQpFdAHz9Fw).
# Test cases
I am using the set `0, ..., n-1` when the list adds up to `n`. In the TIO link, that list is given explicitly to my function.
After the `->`, each line represents one possible way of splitting the set.
```
[1, 1, 1, 1, 1, 1, 1, 1] -> [
    [[0], [1], [2], [3], [4], [5], [6], [7]]
]
[3] -> [
    [[0, 1, 2]]
]
[1, 2] -> [
    [[0], [1, 2]]
    [[1], [0, 2]]
    [[2], [0, 1]]
]
[2, 2] -> [
    [[0, 1], [2, 3]]
    [[0, 2], [1, 3]]
    [[0, 3], [1, 2]]
]
[1, 1, 2] -> [
    [[0], [1], [2, 3]]
    [[0], [2], [1, 3]]
    [[0], [3], [1, 2]]
    [[1], [2], [0, 3]]
    [[1], [3], [0, 2]]
    [[2], [3], [0, 1]]
]
[1, 2, 2] -> [
    [[0], [1, 2], [3, 4]]
    [[0], [1, 3], [2, 4]]
    [[0], [1, 4], [2, 3]]
    [[1], [0, 2], [3, 4]]
    [[1], [0, 3], [2, 4]]
    [[1], [0, 4], [2, 3]]
    [[2], [0, 1], [3, 4]]
    [[2], [0, 3], [1, 4]]
    [[2], [0, 4], [1, 3]]
    [[3], [0, 1], [2, 4]]
    [[3], [0, 2], [1, 4]]
    [[3], [0, 4], [1, 2]]
    [[4], [0, 1], [2, 3]]
    [[4], [0, 2], [1, 3]]
    [[4], [0, 3], [1, 2]]
]
[2, 2, 2] -> [
    [[0, 1], [2, 3], [4, 5]]
    [[0, 1], [2, 4], [3, 5]]
    [[0, 1], [2, 5], [3, 4]]
    [[0, 2], [1, 3], [4, 5]]
    [[0, 2], [1, 4], [3, 5]]
    [[0, 2], [1, 5], [3, 4]]
    [[0, 3], [1, 2], [4, 5]]
    [[0, 3], [1, 4], [2, 5]]
    [[0, 3], [1, 5], [2, 4]]
    [[0, 4], [1, 2], [3, 5]]
    [[0, 4], [1, 3], [2, 5]]
    [[0, 4], [1, 5], [2, 3]]
    [[0, 5], [1, 2], [3, 4]]
    [[0, 5], [1, 3], [2, 4]]
    [[0, 5], [1, 4], [2, 3]]
]
[1, 2, 3] -> [
    [[0], [1, 2], [3, 4, 5]]
    [[0], [1, 3], [2, 4, 5]]
    [[0], [1, 4], [2, 3, 5]]
    [[0], [1, 5], [2, 3, 4]]
    [[0], [2, 3], [1, 4, 5]]
    [[0], [2, 4], [1, 3, 5]]
    [[0], [2, 5], [1, 3, 4]]
    [[0], [3, 4], [1, 2, 5]]
    [[0], [3, 5], [1, 2, 4]]
    [[0], [4, 5], [1, 2, 3]]
    [[1], [0, 2], [3, 4, 5]]
    [[1], [0, 3], [2, 4, 5]]
    [[1], [0, 4], [2, 3, 5]]
    [[1], [0, 5], [2, 3, 4]]
    [[1], [2, 3], [0, 4, 5]]
    [[1], [2, 4], [0, 3, 5]]
    [[1], [2, 5], [0, 3, 4]]
    [[1], [3, 4], [0, 2, 5]]
    [[1], [3, 5], [0, 2, 4]]
    [[1], [4, 5], [0, 2, 3]]
    [[2], [0, 1], [3, 4, 5]]
    [[2], [0, 3], [1, 4, 5]]
    [[2], [0, 4], [1, 3, 5]]
    [[2], [0, 5], [1, 3, 4]]
    [[2], [1, 3], [0, 4, 5]]
    [[2], [1, 4], [0, 3, 5]]
    [[2], [1, 5], [0, 3, 4]]
    [[2], [3, 4], [0, 1, 5]]
    [[2], [3, 5], [0, 1, 4]]
    [[2], [4, 5], [0, 1, 3]]
    [[3], [0, 1], [2, 4, 5]]
    [[3], [0, 2], [1, 4, 5]]
    [[3], [0, 4], [1, 2, 5]]
    [[3], [0, 5], [1, 2, 4]]
    [[3], [1, 2], [0, 4, 5]]
    [[3], [1, 4], [0, 2, 5]]
    [[3], [1, 5], [0, 2, 4]]
    [[3], [2, 4], [0, 1, 5]]
    [[3], [2, 5], [0, 1, 4]]
    [[3], [4, 5], [0, 1, 2]]
    [[4], [0, 1], [2, 3, 5]]
    [[4], [0, 2], [1, 3, 5]]
    [[4], [0, 3], [1, 2, 5]]
    [[4], [0, 5], [1, 2, 3]]
    [[4], [1, 2], [0, 3, 5]]
    [[4], [1, 3], [0, 2, 5]]
    [[4], [1, 5], [0, 2, 3]]
    [[4], [2, 3], [0, 1, 5]]
    [[4], [2, 5], [0, 1, 3]]
    [[4], [3, 5], [0, 1, 2]]
    [[5], [0, 1], [2, 3, 4]]
    [[5], [0, 2], [1, 3, 4]]
    [[5], [0, 3], [1, 2, 4]]
    [[5], [0, 4], [1, 2, 3]]
    [[5], [1, 2], [0, 3, 4]]
    [[5], [1, 3], [0, 2, 4]]
    [[5], [1, 4], [0, 2, 3]]
    [[5], [2, 3], [0, 1, 4]]
    [[5], [2, 4], [0, 1, 3]]
    [[5], [3, 4], [0, 1, 2]]
]
[1, 1, 4] -> [
    [[0], [1], [2, 3, 4, 5]]
    [[0], [2], [1, 3, 4, 5]]
    [[0], [3], [1, 2, 4, 5]]
    [[0], [4], [1, 2, 3, 5]]
    [[0], [5], [1, 2, 3, 4]]
    [[1], [2], [0, 3, 4, 5]]
    [[1], [3], [0, 2, 4, 5]]
    [[1], [4], [0, 2, 3, 5]]
    [[1], [5], [0, 2, 3, 4]]
    [[2], [3], [0, 1, 4, 5]]
    [[2], [4], [0, 1, 3, 5]]
    [[2], [5], [0, 1, 3, 4]]
    [[3], [4], [0, 1, 2, 5]]
    [[3], [5], [0, 1, 2, 4]]
    [[4], [5], [0, 1, 2, 3]]
]
```
---
This is the fifth and **final** challenge of the [RGS Golfing Showdown](https://codegolf.meta.stackexchange.com/q/18545/75323). If you want to participate in the competition, you have 96 hours to submit your eligible answers. Remember there is still 300 reputation in prizes! (See 6 of [the rules](https://codegolf.meta.stackexchange.com/q/18545/75323))
Also, as per section 4 of the rules in the [linked meta post](https://codegolf.meta.stackexchange.com/q/18545/75323), the "restricted languages" for this third challenge are *only* [Sledgehammer](https://codegolf.stackexchange.com/a/200706/75323), [J](https://codegolf.stackexchange.com/a/200834/75323) and [Mathematica](https://codegolf.stackexchange.com/a/200687/75323) so submissions in these languages are not eligible for the final prize. But *they can still be posted!!*
## Final prize
If you want to be considered for the final prize, at the end of your answer to this challenge please add a link to the eligible submissions you want to be considered for your final score, as well as the scores those answers got! This way it will be slightly easier for me to keep track of everything. Thanks!
This is still a regular [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") challenge, so enjoy!
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 9 bytes
```
œεI£€{{}ê
```
[Try it online!](https://tio.run/##yy9OTMpM/e/vY/P/6ORzWz0PLX7UtKa6uvbwqv//ow11jHSMYgE "05AB1E – Try It Online")
```
œ           # permutations of the [0, ..., n-1] input
 ε     }    # for each permutation:
  I£        #  cut it in parts of lengths given by the second input
    €{      #  sort each part
      {     #  sort the list of parts
        ê   # sort and uniquify the list of lists of parts
```
[Answer]
# [Python 3](https://docs.python.org/3/), ~~123~~ ~~118~~ ~~114~~ 112 bytes
Input: set `s` representing a list of `n` unique elements, and an iterable `l` representing the multiset.
Output: a set of all partitions, where each partition is a tuple of tuples of elements (aka output is a set of tuples of tuples).
```
lambda s,l:{(*sorted(p),)for p in product(*(combinations(s,i)for i in l))if{*sum(p,p)}>s}
from itertools import*
```
[Try it online!](https://tio.run/##XVFbTgMxDPzPKazlJ6kCEu0fUjkCFyhVtWWdNiIvEge1qjh7cXa7gJA2sp0Zj@PZdKZjDKurWb9eXe/3Qw9Fu6eLXJSYCQeZlFYmZkhgA6Qch/pGciHfot/b0JONocii7cixjeOUsuayKNXLpJP6ei5fwuTowRJmitEVsD6x@OI6RSjnIu6gFhygqfDxPZENB8hYqiMxoAGKO2cL8ax3PK9fYkD1JJhANfPMEZkePBH4KCVY1thceESbsz@Dw3CgowY6Ymj1Z@8qjvqNseMuefqjK5nPF/rEUu1pzgZsO/KLHwoNNjD1jl3B5k6qVAQ4WAOyrGxcxajnDWxBEhAYarY4JaC0HEnmPhxQBtWYXEM0UIP9qAjo0GNokm3GgbGbG5C51/CerNOgya8fNGUbSDoN3f0zbDqelQ03zP7N0fdpznm90bPZAjX@hlNbNHP7b2F43Zt@BwCdBjZmvth26rp51PD/24rNig@nSw7LKUzYLVv@Qn/vVttv "Python 3 – Try It Online")
## Approach
**Step 1**: For each element `i` of the multiset `l`, we find all combinations of `i` elements of `s`. We then find the Cartesian products of them. This is the list of candidate partitions.  
For example: for `l = [1,2], s = ABC`, we first find all combinations
* of 1 element: `A, B, C`
* of 2 elements: `AB, AC, BC`
The candidate partitions are the Cartesian product of the above list of combinations:
```
[A,AB]
[A,AC]
[A,BC]
[B,AB]
[B,AC]
[B,BC]
[C,AB]
[C,AC]
[C,BC]
```
**Step 2**: Filter out the invalid partitions (partitions that do not add up to `s`).  
For the above example, only the following partitions are kept:
```
[A,BC]
[B,AC]
[C,AB]
```
## Code breakdown
```
lambda s,l:
{
  (*sorted(p),)                     # convert partition to a sorted tuple (of tuples)
  for p in product(                 # for each candidate partition
    *(combinations(s,i)for i in l)
  )
  if{*sum(p,p)}>s                   # keep only if partition add up to s
}                              # put everything in a set to filter out duplicates
```
Each partition is stored as a sorted tuple of sorted tuple. This ensure no duplicate in the final result.
`{*sum(p,p)}>s` checks if a candidate partition is valid (aka contains all element in `s`). This work by putting all elements in the partition and some extra elements into a set, then check if the set is a superset of `s`.
For example: for `s={0,1,2,3}` and valid partition `p=((0,1),(2,3))`:  
`sum(p,p)` evaluates to `((0,1),(2,3),0,1,2,3)`, which when converted into set is a superset of `s`.
For `s={0,1,2,3}` and invalid partition `p=((0,1),(1,2))`:  
`sum(p,p)` evaluates to `((0,1),(1,2),0,1,2)`, which when converted into set becomes `{0,1,2,(0,1),(1,2)}`, not a superset of `s`. 
[Answer]
# JavaScript (ES6), ~~158 156~~ 141 bytes
Takes input as `(a)(r)`, where \$a\$ is the representation of the input set \$l\$ as an ordered array, and \$r\$ is the range \$[1,2,...,n]\$.
Prints the results.
```
a=>r=>(F=(k,m,o=[],p,s=[],n=a[k])=>n?s[n-1]?F(++k,m,[...o,s],a[k]-n?0:s[0]):r.map(i=>i<p|m>>i&1||F(k,m|1<<i,o,i,[...s,i])):console.log(o))(0)
```
[Try it online!](https://tio.run/##bVBda4UgGL7vV3g1lN6kOruqNHax/oTIkE5t7pw0dBuMtd/etGBrYyC8z/t8oT6rN@V7p@eXzNjzsI5sVYw7xnHH8AUmsExImMHHYZgSF0kYN60XJitk2@E0jS5BKbXgJURDZtq88iKXpHJ0UjPWjOtmXibO9U2xLF0sXoqm0WBBb1kPWhJS9dZ4ex3o1T5iSwjOyVqLBCFRAPrnSIjaaR@BKHdUfqPd97OUvzx/lNMxcysTmdDRunvVP2GFGEcfQT1eUJE6MA4xFF9w55x6x4q64fzaDxjPgHoSYzNKAyJy@wn8AEhvtA50sTWMoQm7DR7rA/FJ6vUL "JavaScript (Node.js) – Try It Online")
### Commented
```
a =>                      // a[] = ordered representation of the input set
r => (                    // r[] = range [1, 2, ..., n]
  F = (                   // F is a recursive function taking:
    k,                    //   k = index of the current entry in a[]
    m,                    //   m = bitmask of values already assigned in the output
    o = [],               //   o[] = output
    p,                    //   p = either 0 or a previous value (as a lower bound)
    s = [],               //   s[] = array representing the current set
    n = a[k]              //   n = k-th entry in a[]
  ) =>                    //
    n ?                   // if n is defined:
      s[n - 1] ?          //   if the current set is not full:
        F(                //     do a recursive call:
          ++k,            //       increment k
          m,              //       pass m unchanged
          [...o, s],      //       append s[] to o[]
          a[k] - n ? 0    //       set p to 0 if the next set has a different size
                   : s[0] //       or to s[0] if it has the same size
        )                 //     end of recursive call
      :                   //   else:
        r.map(i =>        //     for each value i in the range r[]:
          i < p |         //       abort if i is less than p
          m >> i & 1 ||   //       or the i-th bit is already set in m
          F(              //       otherwise, do a recursive call:
            k,            //         pass k unchanged
            m | 1 << i,   //         set the i-th bit in m
            o,            //         pass o unchanged
            i,            //         set p to i
            [...s, i]     //         append i to s[]
          )               //       end of recursive call
        )                 //     end of map()
    :                     // else:
      console.log(o)      //   leaf node: print o[]
)(0)                      // initial call to F with k = 0
```
---
### Previous answers
* [RGS 1/5](https://codegolf.stackexchange.com/a/200002/58563) - JavaScript, 37 bytes
* [RGS 2/5](https://codegolf.stackexchange.com/a/200270/58563) -
CP-1610 machine code, 28 bytes (or 27.5)
* [RGS 3/5](https://codegolf.stackexchange.com/a/200501/58563) - JavaScript, 79 bytes
* [RGS 4/5](https://codegolf.stackexchange.com/a/200688/58563) - JavaScript, 206 bytes
Total score: **491 bytes**
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 63 bytes
Uses the range [1,2,...,n] 
```
Union[Sort/@(Sort/@#~TakeList~a&/@Permutations@Range@Tr[a=#])]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n277PzQvMz8vOji/qETfQQNCKdeFJGan@mQWl9Qlquk7BKQW5ZaWADXk5xU7BCXmpac6hBRFJ9oqx2rGqv0PKMrMK1HQd0iPrjbUMdQxqY39/x8A "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jellylanguage/wiki), ~~16~~ ~~15~~ 13 [bytes](https://github.com/DennisMitchell/jellylanguage/wiki/Code-page)
```
Œ!ṁ€R}Ṣ€Ṣ¥€ṢQ
```
-2 bytes thanks to *@NickKennedy* by golfing the loose link to an inline one with `}`.
[Try it online.](https://tio.run/##y0rNyan8///oJMWHOxsfNa0Jqn24cxGQBpKHlkLowP///0cb6BjqGOkYx/6PNtJRMIoFAA)
**Explanation:**
```
Œ!ṁ€R}Ṣ€Ṣ¥€ṢQ  # Main link taking two list arguments
               # i.e. left=[0,1,2,3,4]; right=[1,2,2]
Œ!             #  Get all permutations of the (implicit) left argument
               #   i.e. [0,1,2,3,4] → [[0,1,2,3,4],[0,1,2,4,3],...,[4,3,2,1,0]]
     }         #  Turn a monad into a dyad by using the right argument:
    R          #   Create a range of each inner integers
               #    i.e. [1,2,2] → [1,[1,2],[1,2]]
  ṁ€           #   And mold each permutation based on that
               #    i.e. [3,0,2,4,1] and [1,[1,2],[1,2]] → [3,[0,2],[4,1]]
          €    #  Map,
         ¥     #  using the previous two links as dyad:
      Ṣ€       #   Sort each inner-most list
               #    → [[0,[1,2],[3,4]],[0,[1,2],[3,4]],...,[4,[2,3],[0,1]]]
        Ṣ      #   Then sort each inner list
               #    → [[0,[1,2],[3,4]],[0,[1,2],[3,4]],...,[[0,1],[2,3],4]]
           Ṣ   #  And after the map, sort the outer list
               #   → [[0,[1,2],[3,4]],[0,[1,2],[3,4]],...,[[0,4],[1,3],2]]
            Q  #  And uniquify it
               #   → [[0,[1,2],[3,4]],[0,[1,3],[2,4]],...,[[0,4],[1,3],2]]
               #  (after which the result is output implicitly)
```
---
**Original ~~16~~ 15 [bytes](https://github.com/DennisMitchell/jellylanguage/wiki/Code-page) answer:**
```
⁹R⁸ṁ
Œ!çṢ€Ṣɗ€ṢQ
```
First (semi-complex) Jelly answer, so can definitely be golfed.. I probably can't find the builtins I'm looking for, since I have the feeling there should be a builtin for `⁹R⁸ṁ` similar as 05AB1E's `£`.  
Port of the approach used by *@Grimmy* in [his 05AB1E answer](https://codegolf.stackexchange.com/a/200879/52210).
[Try it online.](https://tio.run/##y0rNyan8//9R486gR407Hu5s5Do6SfHw8oc7Fz1qWgMkT06H0IH///@PNtAx1DHSMdYxif0fDWIZxQIA)
**Explanation:**
```
⁹R⁸ṁ        # Define a link taking two list arguments
            # i.e. left=[1,2,2]; right=[3,0,2,4,1]
⁹           #  Use the left argument
 R          #  And create a range of each inner integers
            #   i.e. [1,2,2] → [1,[1,2],[1,2]]
  ⁸         #  Then take the right argument
   ṁ        #  And mold it based on the earlier list
            #   i.e. [3,0,2,4,1] and [1,[1,2],[1,2]] → [3,[0,2],[4,1]]
Œ!çṢ€Ṣɗ€ṢQ  # Main link taking two list arguments
            # i.e. left=[0,1,2,3,4]; right=[1,2,2]
Œ!          #  Get all permutations of the (implicit) left argument
            #   i.e. [0,1,2,3,4] → [[0,1,2,3,4],[0,1,2,4,3],...,[4,3,2,1,0]]
       €    #  Map,
      ɗ     #  using the previous three links as dyad:
  ç         #   Apply the link we defined above,
            #   which uses this main-link's right as left argument for the helper-link
            #    → [[0,[1,2],[3,4]],[0,[1,2],[4,3]],...,[4,[3,2],[1,0]]]
   Ṣ€       #   Sort each inner-most list
            #    → [[0,[1,2],[3,4]],[0,[1,2],[3,4]],...,[4,[2,3],[0,1]]]
     Ṣ      #   Then sort each inner list
            #    → [[0,[1,2],[3,4]],[0,[1,2],[3,4]],...,[[0,1],[2,3],4]]
        Ṣ   #  And after the map, sort the outer list
            #   → [[0,[1,2],[3,4]],[0,[1,2],[3,4]],...,[[0,4],[1,3],2]]
         Q  #  And uniquify it
            #   → [[0,[1,2],[3,4]],[0,[1,3],[2,4]],...,[[0,4],[1,3],2]]
            #  (after which the result is output implicitly)
```
---
And not that it matters, but my other *RGS Golfing Showdown* answers are:
* 1/5: [MathGolf](https://codegolf.stackexchange.com/a/200033/52210) or [Stax](https://codegolf.stackexchange.com/a/200037/52210), both 9 bytes (or [Java 10](https://codegolf.stackexchange.com/a/200022/52210), 58 bytes)
* 2/5: [Java 8](https://codegolf.stackexchange.com/a/200260/52210), 76 bytes (or [Whitespace](https://codegolf.stackexchange.com/a/200275/52210), 149 bytes)
* 3/5: [Java 8](https://codegolf.stackexchange.com/a/200492/52210), 107 bytes
* 4/5: [Java 8](https://codegolf.stackexchange.com/a/200786/52210), 261 bytes
Total score: **466 bytes**
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 12 bytes
```
œcŒpFQƑ$ƇṢ€Q
```
[Try it online!](https://tio.run/##y0rNyan8///o5OSjkwrcAo9NVDnW/nDnokdNawL///9vqGOkY6xjomMKZhkBAA "Jelly – Try It Online")
A dyadic link taking the list of \$n\$ integers as the left argument and the list of set lengths as the right. Returns a list of lists. 
Thanks to @KevinCruijssen for pointing out an omission in my original answer. 
## Previous RGS submissions:
1. [Jelly 12 bytes](https://codegolf.stackexchange.com/a/200050/42248)
2. [BBC BASIC V 92 bytes](https://codegolf.stackexchange.com/a/200337/42248)
3. [Jelly 37 bytes](https://codegolf.stackexchange.com/a/200539/42248)
4. [R 128 bytes](https://codegolf.stackexchange.com/a/200700/42248)
5. Jelly 12 bytes (this post)
**Total: 281 bytes**
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 12 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
œcŒpṢ€FQƑ$ƇQ
```
**[Try it online!](https://tio.run/##y0rNyan8///o5OSjkwoe7lz0qGmNW@CxiSrH2gP///8fbaBjqGOkY6xjomMa@z/aUEcBiExiAQ "Jelly – Try It Online")**
---
**Overal RGS admissible competition entries:**
[RGS 1/5 - Jelly, 7](https://codegolf.stackexchange.com/a/200043/53748)  
[RGS 2/5 - Husk, 22](https://codegolf.stackexchange.com/a/200376/53748)  
[RGS 3/5 - Jelly, 36](https://codegolf.stackexchange.com/a/200519/53748)  
[RGS 4/5 - MATL, 26](https://codegolf.stackexchange.com/a/200704/53748) \*  
This: 12 
**Total = 103 bytes**
\* Might be 25, but I haven't proven that the 25 would never yield multiple results
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~18~~ 17 bytes
```
œ€.œ€`€€{ʒ€gQ}€{Ù
```
[Try it online!](https://tio.run/##yy9OTMpM/e/vY/P/6ORHTWv0wGQCEANR9alJQDI9sBbEPjzz//9oQx0jHaNYAA "05AB1E – Try It Online"), or [verify some test cases](https://tio.run/##yy9OTMpM/V9Waa@koGunoGRfeWilv4/N/6OTHzWt0QOTCUAMRNWHZ56aBKTTD60LrIXw/@vU/o@ONtRRQKBYHRDfCEgZQ5hQHogCsWIB)
---
### Explanation
```
                                     - Takes input of the numbers [1..N]
œ                                    - Permutations of this list
 €.œ                                 - Partitions of each of these permutations
    €`                               - Flatten these 1 level
      €€{                            - Sort the lists in each list in each partition
        ʒ                            - Filter the partitions 
          €g                         - Where the size of the sub partitions...
            Q}                       - Equal to the second input (l)
              €{Ù                    - Sort and uniquify these
                                     - Output implicitly
```
---
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-Q`](https://codegolf.meta.stackexchange.com/a/14339/), 13 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
á £V®Xj0Z ñ
â
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LVE&code=4SCjVq5YajBaIPEK4g&input=WzAsMSwyXQpbM10)
**Submissions**
(1/5) [Japt, 9 bytes](https://codegolf.stackexchange.com/a/200132/84206)
(2/5) [CJam, 23 bytes](https://codegolf.stackexchange.com/a/200333/84206)
(3/5) [Japt, 40 or 41 bytes](https://codegolf.stackexchange.com/a/200529/84206) (I don't know which one to use, I'm not sure if the 40 byte one is valid)
(4/5) [Magma, 34 bytes](https://codegolf.stackexchange.com/a/200720/84206)
**Total Score: 120 (or maybe 119)**
[Answer]
# [J](http://jsoftware.com/), 47 bytes
```
[:~.~:@I.(/:(#,])&.>)@(<@/:~;.1)"1[:(!A.&i.])+/
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/o63q9OqsHDz1NPStNJR1YjXV9Ow0HTRsHPSt6qz1DDWVDKOtNBQd9dQy9WI1tfX/a3KlJmfkK6QpGAKhEYJjhMxBgTBhHTNk1cb/AQ "J – Try It Online")
I entirely missed the Portuguese one, so I'm out of the final prize anyway.
And J is not so good for handling non-rectangular arrays.
### How it works
```
[:~.~:@I.(/:(#,])&.>)@(<@/:~;.1)"1[:(!A.&i.])+/
[:(!A.&i.])+/    NB. all permutations of 0..n-1
           +/    NB. sum of l, i.e. the value of n
  (   &i.])      NB. array of 0..n-1
   !  &i.        NB. array of 0..n!-1
    A.           NB. (0..n!-1)-th permutations of 0..n-1
~:@I.    NB. cut vector (1 2 3 -> 1 1 0 1 0 0)
   I.    NB. for each number k at index i, k copies of i
         NB. e.g. 1 2 3 -> 0 1 1 2 2 2
~:@      NB. nub sieve; does each item appear for the first time?
(/:(#,])&.>)@(<@/:~;.1)"1    NB. cut, sort each item, and sort each row
                       "1    NB. on each row...
             (     ;.1)    NB. cut to the lengths of l
                           NB. e.g. 1 1 0 (f;.1) 0 1 2 -> (f 0)(f 1 2)
              <@/:~        NB. sort each item and enclose
(          )@     NB. then...
 /:               NB. sort the row by...
   (   )&.>       NB. the result applied to each item x...
    #,]           NB. the length of x, followed by x itself
                  NB. that is, sort by lengths then content
[:~.    NB. finally, remove duplicate rows to get the answer
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), 14 [bytes](https://github.com/barbuz/Husk/wiki/Codepage)
```
u→SġÖȯLuΣmOΠMṖ
```
**[Try it online!](https://tio.run/##yygtzv7/v/RR26TgIwsPTzux3qf03OJc/3MLfB/unPb///9oQx1DHZPY/9EGQNpIx1jHRMc0FgA "Husk – Try It Online")**
...I feel like the `→SġÖȯLuΣ` (last-entry-of hook group-by sort-by compose length deduplicate concatenated) should be `XȯLuΣ` where `X` is "maximals-by-predicate", saving 3 bytes, but I can't seem to find such a high-level-function. Maybe I'm being blind?
[Answer]
# [GAP](https://www.gap-system.org/), ~~145 127~~ 105 bytes
```
f:={l,c}->(i->Orbit(SymmetricGroup(c),Set(l,n->Set([1..n],k->NextIterator(i))),OnSetsSets))(Iterator(c));
```
[Try it online!](https://tio.run/##PYzBCsIwEER/pfS0C5vSiHhQzFW8WKFHm0MNqYS2aYkrKOK3x8aDMAMDb2Zu7Rxjt92/BzIfocAJVYWrY6hf42g5OHMI02MGg1RbhoG8UClcZFF4Tb1QJ/vkI9vQ8hTAISJVfmnckxHhjwziLp6D8wzdMidJa03pZqORsrzxjc8p@6FVAiTLRaVOsy8 "GAP – Try It Online")
This is absurdly long, but I like computing the answer as an orbit of a group action. I have mixed feelings about creating the first element using an `Iterator`...
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 20 bytes
```
{SMfqQlMTSMMs./M.pUs
```
[Try it online!](https://tio.run/##K6gsyfj/vzrYN60wMMc3JNjXt1hP31evILT4//9oQx0jHeNYAA "Pyth – Try It Online")
### Explanation
```
{SMfqQlMTSMMs./M.pUsQ # full program (Q=input, last one is implicit)
                  UsQ # range(sum(Q))
                .p    # get all permutations
            s./M      # for each permutation, get all partitions, concatenate to one list
         SMM          # sort each list in each partition
   f                  # keep only the partitions T where
    qQ                # Q ==
      lMT             #      map each list in a partition T to its length
 SM                   # now sort the filtered partitions
{                     # and deduplicate
```
[Answer]
# [R](https://www.r-project.org/) (with partitions library), 86 bytes
```
function(l,n)lapply(partitions::listParts(n),function(x)if(all(lengths(x)==l))show(x))
```
[Try it online at RDRR!](https://rdrr.io/snippets/embed/?code=f%3D%0Afunction(l%2Cn)lapply(partitions%3A%3AlistParts(n)%2Cfunction(x)if(all(lengths(x)%3D%3Dl))show(x))%0Ainvisible(f(c(1%2C%201%2C%201%2C%201%2C%201%2C%201%2C%201%2C%201)%2C%208))%0Ainvisible(f(c(2%2C%201)%2C3))%0Ainvisible(f(c(2%2C2%2C1)%2C%205)))
Assumes that `l` is sorted in decreasing order. Will print a lot of fluff after the answer, so I advise to call `invisible(f(l, n))` rather than `f(l, n)`.
The function `listParts` lists all the partitions of `1:n`; they are then filtered to keep only those whose lengths match the values of `l`.
Previous submissions, all in R (not that R is a competitive language!):
1. [38 bytes](https://codegolf.stackexchange.com/a/200005/86301)
2. [73 bytes](https://codegolf.stackexchange.com/a/200283/86301) (also [SPL, 398 bytes](https://codegolf.stackexchange.com/a/200426/86301))
3. [111 bytes](https://codegolf.stackexchange.com/a/200610/86301)
4. [68 bytes](https://codegolf.stackexchange.com/a/200693/86301)
**Total: 376 bytes**
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 95 bytes
```
⊞υＥ⊕⌈θＥ№θι⟦⟧Ｆη«≔υζ≔⟦⟧υＦζＦＬκＦ∨⊕⌕§κλ⟦⟧№θλ¿‹Ｌ§§κλμλ⊞υＥκ⎇⁻ξλνＥν⎇⁻ρμπ⁺π⟦ι⟧»≔⟦⟧ζＦυ«≔⟦⟧εＦιＦκ⊞ελ⊞ζε»⪫ζ¶
```
[Try it online!](https://tio.run/##XVDLasMwEDzXX7HkJIEKfRx7CoVASk196E31wdhKLCyvE8kqrku@3V35EdyAQBrN7szu5GVm8yYzw5B4VzIvIM5ObI@5VbXCVhUszjpd@5qdOZ/I18Zjy84CNH3IlHP@Eh0aC6zk8BvdbZ3TRwxKPRELlKkAH/BY2XMY73eFx7ZkFZ/xh/1nvdNYsG27x0J1rBJgZkMB1xkM2YM@BCnnFr2l5aa1Dp3UAOtViftUFjP7w2KN3rFuKsaJxlvaBh0BJwGJIUi31CGDMYZLtFq3X3Lx61wCo65B6Hnxah5KBXMiR9BPlZcosZq2fWs0hr/NF27IbBikfBRA54kk5cP0FPCcpsP9t/kD "Charcoal – Try It Online") Link is to verbose version of code. I don't often get to use the `r` variable; I think this might be only the second time ever. Takes the set counts and unique entries as arguments. Explanation:
```
⊞υＥ⊕⌈θＥ№θι⟦⟧
```
Make a list of lists of sets (also actually lists), where each element of that list will have a number of sets equal to the count of occurrences of that index in the input set counts, and push that list to the predefined empty list, which is now technically a list of lists of lists of lists.
```
Ｆη«
```
Loop over the unique entries.
```
≔υζ≔⟦⟧υ
```
Move the list of lists of lists of sets into a temporary variable so that it can be cleared to accumulate the results of this pass.
```
Ｆζ
```
Loop over each list of lists of sets from the previous pass.
```
ＦＬκ
```
Loop over each possible set count.
```
Ｆ∨⊕⌕§κλ⟦⟧№θλ
```
Loop over each set, but if there is more than one empty set then stop at the first.
```
¿‹Ｌ§§κλμλ
```
Ignore this set if it's full.
```
⊞υＥκ⎇⁻ξλνＥν⎇⁻ρμπ⁺π⟦ι⟧
```
Construct a new list of lists of sets by replacing the one at the current set count with a new list of sets constructed by replacing the current set by union with the current unique entry. This is done to ensure that the new lists are all clones.
```
»≔⟦⟧ζＦυ«≔⟦⟧εＦιＦκ⊞ελ⊞ζε»
```
Flatten each list of lists of sets in the resulting list into a list of sets.
```
⪫ζ¶
```
Output the list of lists of sets in a human-readable manner. (This only costs 1 byte, so I think it's fair.)
### Submission history:
(1/5) Charcoal, 19 bytes (Retina 0.8.2, 68 bytes)
(2/5) Charcoal, 31 bytes (Retina, 74 bytes)
(3/5) vi, 48 bytes (Charcoal, 50 bytes; Batch, 265 bytes)
(4/5) Charcoal, 41 bytes
(5/5) Charcoal, 95 bytes
Total score: 234 bytes
Total Charcoal score: 236 bytes
Wooden Spoon score: 543 bytes
]