[Question]
  [
The challenge - given a numeric list L and an integer N as inputs, write a function that:
1. finds the bucket sizes for L such that it is split into N *whole* buckets of equal or near-equal size, and
2. returns for each element in L the minimum of that element's bucket.
Example -
```
L=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]  
N=5
```
Compute the bucket sizes with the following:
\$\left \lfloor \frac{| L |}{N} \right \rfloor + 1\$ elements go into \$|L| \bmod 
 N\$ buckets, and 
\$\left \lfloor \frac{| L |}{N} \right \rfloor \$ go into the rest, 
where |L| is the length of L. For the above, we get
`floor(12/5)+1` into `12 mod 5` buckets, and `floor(12/5)` in the rest:
```
[[0, 1, 2], [3, 4, 5], [6, 7], [8, 9], [10, 11]]
```
Finally, we output a list where each element is the minimum of its bucket:
```
[0, 0, 0, 3, 3, 3, 6, 6, 8, 8, 10, 10]
```
Some test cases:
```
In -> Out
[1, 2, 3, 4], 1 -> [1, 1, 1, 1]
[1, 2, 3, 4], 2 -> [1, 1, 3, 3]
[0, 2, 4, 6, 8], 3 -> [0, 0, 4, 4, 8]
[9, 3, 0, 1, 5, 7, 4, 6, 8, 10, 12, 11, 2, 13], 5 -> [0, 0, 0, 1, 1, 1, 4, 4, 4, 10, 10, 10, 2, 2]
[3, 0, -2, 0, -1], 2 -> [-2, -2, -2, -1, -1]
```
This is a code golf challenge. Shortest answer in bytes wins. Standard loopholes apply and such.
Edit:
1. you may assume L is not empty
2. you do not have to handle the case where N>|L|
3. your answer should return a flat list
[Sandbox](https://codegolf.meta.stackexchange.com/a/18458/88520)
  
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 40 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319 "When can APL characters be counted as 1 byte each?")[SBCS](https://github.com/abrudz/SBCS ".dyalog files using a single byte character set")
Anonymous infix lambda. Takes \$N\$ as left argument and \$L\$ as right argument.
```
{p/⌊/¨(-p)↑¨↑∘⍵¨+\p←1+@(⍳⍺|l)⌊⍺⍴⍺÷⍨l←≢⍵}
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///v7pA/1FPl/6hFRq6BZqP2iYeWgEkHnXMeNS79dAK7ZiCR20TDLUdNB71bn7Uu6smRxOoGMh41LsFSB7e/qh3RQ5QxaPORUD1tf/TQOzevkd9Uz39H3U1H1pvDDKsb2pwkDOQDPHwDP5vqpCmYKCjYKijYKSjYKyjYKKjYKqjYKajYK6jYKGjYAmUAkkbchkCFSJUcRmhco0hxhiBDQDqtuACGWwJloUYbwo2EioLNdUIZDJYl6ExWMOj3jUA "APL (Dyalog Unicode) – Try It Online")
`{`…`}` \$⍺:=N,\ ⍵:=L\$
 `l←≢⍵` \$l:=|L|\$
 `⍺÷⍨` \$l\over N\$
 `⍺⍴` \$(\underbrace{\frac{l}N,\frac{l}N,\frac{l}N,\cdots,\frac{l}N}\_{N\text{ elements}})\$
 `⌊` \$(\underbrace{\left\lfloor\frac{l}N\right\rfloor,\left\lfloor\frac{l}N\right\rfloor,\left\lfloor\frac{l}N\right\rfloor,\cdots,\left\lfloor\frac{l}N\right\rfloor}\_{N\text{ elements}})\$
 `1+@(`…`)` increment **at** the following indices:
  `⍺|l` \$|L|\bmod N\$
  `⍳` \$(1,2,3,…,|L|\bmod N)\$
 `p←` \$p:=(\underbrace{\overbrace{1+\left\lfloor\frac{l}N\right\rfloor,1+\left\lfloor\frac{l}N\right\rfloor,\cdots,1+\left\lfloor\frac{l}N\right\rfloor}^{|L|\bmod N\text{ elements}},\left\lfloor\frac{l}N\right\rfloor,\left\lfloor\frac{l}N\right\rfloor,\cdots,\left\lfloor\frac{l}N\right\rfloor}\_{|n|\bmod N\text{ elements}})\$
 `+\` cumulative sum of that list
 `↑∘⍵¨` for each element, take that many elements from \$L\$
 `(-p)↑¨` for each list, take as many trailing elements as the corresponding number in \$p\$
 `⌊/¨` minimum of each list
 `p/` replicate each minimum by the the corresponding number in \$p\$
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 7 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
œsṂṁ$€F
```
A dyadic Link accepting `L` on the left and `N` on the right which yields a list as specified.
**[Try it online!](https://tio.run/##y0rNyan8///o5OKHO5se7mxUedS0xu3////RljoKxjoKBjoKhjoKpjoK5joKJjoKZjoKFkARkKgREAOlQJRx7H9TAA "Jelly – Try It Online")** Or see the [test-suite](https://tio.run/##y0rNyan8///o5OKHO5se7mxUedS0xu3/0T2Hl@sDWSpHJz3cOQPIAKIsENUw59A2XTuFRw1zsx417ju07dC2//@jo6MNdRSMdBSMdRRMYnUUDGO5dNCEjMBCBmAhEx0FMx0FC6CoMVjUEqwKKAfUYaqjYA5XARQBiQK1GEIMMzQGajIFa4Lo0DWCUIYQK2IBE "Jelly – Try It Online").
(Also `œsµṂṁ)F` is the same.)
### How?
```
œsṂṁ$€F - Link: list of order-able items, L; positive integer, N
œs      - split L into N chucks, longer ones to the left
     €  - for each chunk:
    $   -   last two links as a monad - i.e. f(chunk):
  Ṃ     -     minimum of chunk
   ṁ    -     mould like chunk
      F - flatten
```
[Answer]
# JavaScript (ES6), ~~101~~ 87 bytes
Takes input as `(array)(n)`.
```
a=>n=>a.map(w=_=>--w?m:m=Math.min(...a.slice(p,p+=w=L/n+(i++<L%n)|0)),L=a.length,i=p=0)
```
[Try it online!](https://tio.run/##lZDdToQwEEbvfYq5MWnDUP5XduPgC@ATGGIaZHdroJCFyI3vjrSIq27U2Hy9auZ80/MsX2RfnlQ3uLp9qqY9TZIyTZkUjezYSI@Uue541@waupfDUTRKMyGEFH2tyop12Dk0Uu5phynHuc2vNX/1OcecpKgrfRiOqKgjn09lq/u2rkTdHtiePfgIAUKIECHECAnCBuEGIUXYzk/mOSg4SziH9XgemLEl0ZqNTWpjx/zi6lvXuWgmBp@IPx/TFdgVTX4nhv8kmr0viL4lxstnZmj0N/TsI7ZJL6BbW7aoTqzeeLVlVYXGsi0OonfZXyR/GIjXLIaXO4@FxfQG "JavaScript (Node.js) – Try It Online")
## How?
### Variables
* \$L\$ is the length of the input array
* \$i\$ is the ID of the current bucket
* \$w\$ is the width of the current bucket
* \$m\$ is the minimum value in the current bucket
* \$p\$ is a pointer to the starting point of the next bucket
### Commented
```
a => n =>                     // given the input array a[] and the integer n
  a.map(w =                   // initialize w to a non-numeric value
  _ =>                        // for each value in a[]:
    --w ?                     //   decrement w; if it's not equal to 0:
      m                       //     append the current minimum
    :                         //   else:
      m =                     //     append the updated value of m
        Math.min(             //       which is the minimum value found in
          ...a.slice(         //         the slice of a[]
            p,                //           starting at p
            p +=              //           and ending at the updated value of p (-1):
              w =             //             update w:
                L / n +       //               floor(L / n) is the base width
                (i++ < L % n) //               add 1 if i is less than L mod n
                              //               (then increment i)
                | 0           //               apply the floor()
          )                   //         end of slice()
        ),                    //       end of Math.min()
    L = a.length,             //   initialize L
    i = p = 0                 //   start with i = p = 0
  )                           // end of map()
```
[Answer]
# [J](http://jsoftware.com/), ~~52~~ ~~50~~ ~~47~~ ~~42~~ ~~39~~ ~~37~~ ~~35~~ ~~32~~ 27 bytes
```
](]#(<.//.~I.))[:+/-@[]\]=]
```
[Try it online!](https://tio.run/##hU7LCsIwELz3KxY91KJNu0lb22BBEATBk9caPIhFvPgH/nqcTVsULzLJYXceOw8/U3FPraWYVpSTxU8V7U7HvXcLN19sVJap10ElSWeXWbrt3Nm1zifR7Xp/Ukk9DEyaDBWYKlpTTQ0xlhwNmjzABFRADQiPQ/ZPQPDzCKgZ6lH74SQXnP7l5GoB1MKacEdjRIHvXkN2ETC0YtHpqVwDq6hKFAvmINFoBw0bGrIuenosb6wjTuxyWUX@DQ "J – Try It Online")
This solution doesn't use any of the arithmetic formulas. Instead it relies on
geometric transformations.
We'll use the example
```
5 f 0 1 2 3 4 5 6 7 8 9 10 11
```
to see how the transformations work:
* `]=]` Does the input equal itself, elementwise? This converts the input to ones:
```
1 1 1 1 1 1 1 1 1 1 1 1
```
* `-@[]\` Split it into rows whose size is `5` (the left arg), filling the final partial row with zeros:
```
1 1 1 1 1
1 1 1 1 1
1 1 0 0 0
```
* `[:+/` Sum the rows:
```
3 3 2 2 2
```
* `] (...(...)) <above result>` Execute the verb in parens with that result (`3 3 2 2 2`) as the right arg, and the original list `]` as the left arg. Now we'll break down the verb in inner parens first...
* `<.//.~I.` This is a dyadic hook which first transforms the right arg `3 3 2 2 2` using `I.`, which duplicates the indexes in place according to the multiplier at each index. Thus `I. 3 3 2 2 2` gives:
```
0 0 0 1 1 1 2 2 3 3 4 4          
```
* `<.//.~` Use this mask to group `/.~` the implicit left arg (the original list):
```
0 0 0  1 1 1  2 2  3 3  4  4  <-- Mask
0 1 2  3 4 5  6 7  8 9  10 11 <-- Original List
```
* `<./` Returning the min of each group:
```
0 3 6 8 10
```
* `]#( ... )` Returning to the verb in outer parens: Make right arg `]` (ie, `3 3 2 2 2`) copies of `#` the result of the verb in the inner parens. Thus: make 3 copies of the min of the first group, 3 copies of the min of the 2nd group, 2 copies of the min of the third group, etc:
```
0 0 0 3 3 3 6 6 8 8 10 10
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 8 bytes
```
smLhSdcF
```
[Try it online!](https://tio.run/##K6gsyfj/vzjXJyM4Jdnt/39THYVoAx0FQx0FIx0FYx0FEx0FoJCZjoK5joKFjoIlUAokbRgLAA "Pyth – Try It Online")
This answer is mostly straightforward in that `c` provides the appropriate splitting behaviour. After that, we map twice to each element of the inner list the element of that list which is minimal. The interesting part is performing this double map: `mLhSd` expands into `mmhSdd`.
[Answer]
# [R](https://www.r-project.org/), ~~52~~ 47 bytes
```
function(L,n)ave(L,sort(seq(0,a=L)%%n),FUN=min)
```
[Try it online!](https://tio.run/##NYy7CoNAFET7fMVthHvDCPsyxiW2qSRdPkDEBYusRE1@f7NbpBjmcAZmS4FuNaXwidOxrJEHRBm/c@593Q7e5zcrjP0gVRUF9@ejfy1RUmDltUYjp8DaO@g/mALKu7OBLThxB7IgBdKgBtSCHOgCumZTrMnJUykr@TH9AA "R – Try It Online")
`ave` replaces each member of a group with the value provided by `FUN` applied to that group; the rest is just figuring out the groups.
Thanks to Robin Ryder for -5 bytes.
[Answer]
# [Python 3.8](https://docs.python.org/3.8/), 90 bytes
```
lambda L,N,x=0:sum([(w:=len(L)//N+(v<len(L)%N))*[min(L[x:(x:=x+w)])]for v in range(N)],[])
```
**[Try it online!](https://tio.run/##XY9LDoIwEIb3nmI2JjM6Rgs@G7mB4QK1C4ygJFJJfeHpsYCaajed@b/5pmn5vB7PJlyWts6ibX1Kit0@gQ3HXEUTebkVqPAho1NqcEPjcTzE@7pr@jHRQBW5q1UlsZJRNXyQJp2dLdwhN2ATc0gxJs1KU93EiT1cGoI9eB9UgiFgCBmmmkHQh/AfCXwyacmUYc6wdDD04ap13IjzZwyL76BLmtSZolstQufOfLcTR0F3iZ93SbZVaXNzxeYn5PUZDtrIz6h@AQ "Python 3.8 – Try It Online")**
[Answer]
# [CJam](https://sourceforge.net/p/cjam), 25 bytes
```
q~\_,@d/m]/{_,\[:e<]*}%e_
```
[Try it online!](https://tio.run/##S85KzP3/v7AuJl7HIUU/N1a/Ol4nJtoq1SZWq1Y1Nf5/wv9oAwUjBRMFMwWLWAVjAA "CJam – Try It Online")
## Explanation
```
q~                         "Read whole input & eval";
  \                        "Swap the splitted-items down";
   _                       "Copy the list";
    ,                      "Find its length";
     @                     "Roll the 3rd-to-top on top";
      d                    "Convert the number to double";
       /                   "Divide them (resulting in a float)";
        m]                 "Find the ceiling of that number";
          /                "Divide the list into that many chunks";
           {         }%    "Map every item in that list";
            _,\            "Preserve the length of the list";
                :e<        "e< doesn't take a single list, so";
                           "we have to reduce by minimum";
               [   ]       "Turn this result into a list";
                    *      "Repeat the list that many times";
                       ]   "Put the result into a list";
                        e_ "Flatten the list";
```
[Answer]
# Python, 118 bytes
```
def f(L,N):l=len(L);s=l//N;m=l%N;return sum([[min(L[s*i+i*(m>0):s*i+s+i*(m>0)+(i<m)])]*(s+(i<m))for i in range(N)],[])
```
[Try it online!](https://tio.run/##bYpLDoIwFAD3nKIbk/fgJSD4BfEEpBdoujCx1SZtIS0sPH3FGHfuZjIzvebn6JuU7kozDQNxbG1vlYcBu9jbsuSd6@2Gd0HNS/AsLg6EcGYdRMxNYXJw1wrbD8efFWAuDiXKHOKXUY@BGWY8Czf/UMBRkpCYpmD8DJkGUdGWampoR3s60JFOdJbEasww@zOtqVlTegM)
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 21 bytes
```
Ｆη⊞υＥ÷Ｌθ⁻ηι⊟θＦ⮌υＩＥι⌊ι
```
[Try it online!](https://tio.run/##HYzLCsIwEEX3fsUsJzCC9S0udSMoFLeli1BjM9CmNY/@fpx2ee/hnMZq3wy6y/k7eECroEzBYiJ46REfLt554o/Bp3FttPhTAtilgJaAlaxyGOVV6rpaAm8zGR8MJiUlzy7iTYeIc4wXlfvUo5hi5FxVG4KCYEuwI9gTHAiOBCeCM8FF0IyLWv46r6fuDw "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
Ｆη
```
Loop from `N` down to `1`.
```
⊞υＥ÷Ｌθ⁻ηι⊟θ
```
Remove the last `|L|/N` elements of `L` and add them to a separate list.
```
Ｆ⮌υＩＥι⌊ι
```
Reverse the secondary list to restore the elements to their original order, but map each to their minimum before implicitly printing them on separate lines.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~7~~ 5 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
äεWδ,
```
-2 bytes thanks to *@Grimmy*.
Prints each of the integers on a separated line.
[Try it online](https://tio.run/##yy9OTMpM/f//8JJzW8PPbdH5/9@UK9pSR8FYR8FAR8FQR8FUR8FcR8FER8FMR8ECKAISNQJioBSIMo79r6ubl6@bk1hVCQA) or [verify all test cases](https://tio.run/##yy9OTMpM/W/qpuSZV1BaUmyloGTv6WKvpJCYlwJjPmqbBGQWcyn5l5YA1QCV6Pw/vOTc1vBzW3T@1x7aZv/fkCvaUMdIx1jHJJbLCIltzBVtAGSb6JjpWMRymXJFW@ooGOsoGOgoGOoomOoomOsomOgomOkoWABFQKJGQAyUAlHGYA0QpUZgbSZgPWZgbUANllA9hrH/dXXz8nVzEqsqAQ).
Outputting as a list would be **6 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)** instead:
```
äεWδ]˜
```
[Try it online](https://tio.run/##yy9OTMpM/f//8JJzW8PPbYk9Pef/f1OuaEsdBWMdBQMdBUMdBVMdBXMdBRMdBTMdBQugCEjUCIiBUiDKOPa/rm5evm5OYlUlAA) or [verify all test cases](https://tio.run/##yy9OTMpM/W/q5ulir6SQmJeioGQPZj5qmwRkFv8/vOTc1vBzW2prT8/5r/PfkCvaUMdIx1jHJJbLCIltzBVtAGSb6JjpWMRymXJFW@ooGOsoGOgoGOoomOoomOsomOgomOkoWABFQKJGQAyUAlHGYA0QpUZgbSZgPWZgbUANllA9hrH/dXXz8nVzEqsqAQ).
**Explanation:**
```
ä       # Split the (implicit) input-list into the (implicit) input-integer
        # amount of pieces, with smaller pieces at the left side if not all are equal
 ε      # Map each inner integer-list to:
  W     #  Push the minimum (without popping the list itself)
   δ    #  Using this minimum, apply to each value in the list:
    ,   #   Print (this minimum) with trailing newline
ä       # Split the (implicit) input-list into the (implicit) input-integer
        # amount of pieces, with smaller pieces at the left side if not all are equal
 ε      # Map each inner integer-list to:
  W     #  Push the minimum (without popping the list itself)
   δ    #  Using this minimum, apply to each value in the list:
    ]   #   Close both this double-vectorized apply-each, as well as the map itself,
        #   leaving the minimums in the inner lists after the apply-each is finished
     ˜  # Flatten this list of integer-lists
        # (after which the resulting list is output implicitly as result)
```
[Answer]
# [~~Perl 6~~ Raku](https://github.com/nxadm/rakudo-pkg), ~~66 65 63~~ 59 bytes
-4 bytes thanks to Jo King.
```
{flat map {.min xx$_},@^m.rotor((1,0 X+@m/$^n)Zxx@m%$n,$n)}
```
[Try it online!](https://tio.run/##bY7dTgIxFITv@xSTuCrEZmX5E0JMMNzwAF4YDZgiXWig7dp2Zclmn309rEQu9PLMzDdzMun2w1ofb9LHukz3IkCLDGWslUFRRO8Vny517GywrtVKeAcvd1N9Hy1N@7Uopvo6Mjwy7aqeMFayKzxvpZO3HgKrfAPqcGKXry3ClpozJ7@kCZ4u5ZHm5iMoa5A6q3GwbqfMhiyJVDkfEJSWMVXO7YEwx6FCk/IgxucrLz9zaoMIQeos@JilrbeEo8vR4@gvOJL2hM2enmdzlFjLVOT7gLJCxSrGvDiC8h1K/SIcA44hxwPHiGNM1slOFnxARWfgz8B/eveidxq93/SOyOpdrHGT//lg0KyeY@fh7mm8wZMekfRE/Q0 "Perl 6 – Try It Online")
This function causes an exception when first executed, but subsequently works. In previous versions of Rakudo, it always worked, and I have [filed a Rakudo bug](https://github.com/rakudo/rakudo/issues/3444). Thanks for helping me find it.
## Explanation
```
{                                                         } # anonymous function with parameters @m (array) and $n (bucket size)
                                       @m/$^n               # calculate bucket size: length(@m) / $n
                                (1,0 X+      )              # make a list consisting of 1 + bucket-size, bucket-size
                                                            # using the cross-product metaoperator X with operator +
                                              Zxx@m%$n,$n   # repeat (1 + bucket-size) length(@m) % $n times
                                                            # and repeat bucket-size $n times (* didn't work)
                                                            # using the zip metaoperator Z with operator xx
                      @^m.rotor(                         )  # take batches of those sizes from the list @m
      map {.min xx$_},  # replace each bucket with its minimum repeated by its length
 flat                   # flatten the list
```
# Previous version, ~~65~~ 61 bytes
```
{$/=$^m/$^n;flat map {.min xx$_},$m.rotor(1+$/xx$m%$n,$/xx*)}
```
[Try it online!](https://tio.run/##dY7BCoMwEETvfsUetkXbRU2iVhG/pGjJoULBqFgPivjtaUwtnnpb5s3sTP8cmkSr@VwXesGgwEoFWLV53cgRlOxh8dWrhWnCx0qo/KEbu8FlVwyMpE7Y0nZdvFXnjvOWM9TuPSRgBJxAEEQEMUFCcCNICTKDNsxKir38FzjcpWF/dH7oodUj@zc1SBwos/7vgti27ra9mG/lNs6ESZoR@gM "Perl 6 – Try It Online")
## Explanation
```
{                                                           } # anonymous function with params $m (array) and $n (bucket size)
 $/=$^m/$^n;                                                  # calculate minimum bucket size $/
                                          1+$/xx$m%$n         # take (length of m)%n batches of size 1+$/
                                                     ,$/xx*   # and then as many batches of size $/ as possible
                                 $m.rotor(                 )  # from the list $m
                 map {.min xx$_},                             # replace each bucket with its minimum repeated by its length
            flat                                              # flatten the list
```
[Answer]
# Haskell, ~~158~~ 145 bytes
*Thank you @SirBogman and @PostRockGarfHunter for saving 13 bytes and for the great tip*
Please feel free to improve it.
```
l%n=map(minimum.o)[0..t-1]where(t,w,v,g,a)=(length l,t`div`n,w+1,t`mod`n*v,map(l!!));n&b=div n b*b;o i|i<g=a[i&v..i&v+w]|b<-g+(i-g)&w=a[b..b+w-1]
```
## Explanation
```
list % n=
  map
  (minimum . sublist)
  [0..listSize - 1]
  where
    (listSize, widthLastBlocks, widthFirstBlocks, lengthFirstBlocks, indecesToElem)=
      (length l                        -- t
      ,listSize`div`n                  -- w
      ,widthLastBlocks+1               -- v
      ,listSize`mod`n*widthFirstBlocks -- g
      ,map(list!!))                    -- a
    n & b = div n b * b -- bigest multiple of b smaller than n
    sublist i           -- o
      |i < lengthFirstBlocks =
        indecesToElem [i & widthFirstBlocks
                       ..
                       i&widthFirstBlocks + widthFirstBlocks - 1]
      |b <- lenghtFirstBlocks + (i - lengthFirstBlocks) & widthLastBlocks =
        indecesToElem [b..b + widthLastBlocks - 1]
```
[Answer]
# [Haskell](https://www.haskell.org/), 116 bytes
```
p=replicate
[]&_=[]
f&(x:xs)=(p x$minimum$take x f)++(drop x f)&xs
f%n|(q,r)<-divMod(length f)n=f&((p r$q+1)++p n q)
```
[Try it online!](https://tio.run/##XY5LboMwEIb3nGIWgIyYIGwgL9VHyAmQVaFgEitgjKGVF707MV2kVRbz@kb/P3Nv5ofs@3U13ErTq2uzyKAW8SevRdDFxJ3dnHBiwIWD0mr4GsKleUhw0CVpSlo7mt8@dnPQRfqHTGiTj12rvi9jS3qpb8vdrzX3Xt7FhlNKvdCAhilZh0Zp4NCOARir9BLWeZZRKqLqBWiWlSKibzP7EyDDEvd4FFHxgieEAiFHoAgVwgGhRNgjHD3ZKPPhV1sp/h8rMMcd25L/ga1P "Haskell – Try It Online")
The `%` operator is the bucket and minimize function, where `f` is the list and `n` is the bucket size.
The `&` operator is a helper that repeats `x` times the minimum of the first `x` elements of the list `f`, where `x` is the head of the right parameter list. The sum of the right parameter list may be greater than the length of the left parameter list, but the left parameter list must be divided evenly.
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~91~~ 77 bytes
```
->l,n{(0..z=l.size).flat_map{|x|(k=l.slice!(0,z/n+(z%n>x ?1:0))).map{k.min}}}
```
[Try it online!](https://tio.run/##bY5bC4JAEIXf/RXTQ7DStO16ywLth8gSFQqSiXSBWvW3m3uRfAjOPsyZ78zZ@@v8GYpkWKcV1i1hlMqkoo9S5i4tqtPzeDs1bffuyFXZVXnJF4Sh3NQrIpd1@oYD3zPXdanirvRW1n3fDw0UWcYQOIKH4CMECCFChLBFiBF240qtucBQOJr@oQL5H8@zHtNeoI/FAn1r7zRnKkNdYxHb5Kk2HeW@Kh0yBRv5k6IpMqUYCCdTJ61mo0ro0dwItOKZw/AXDCaZq@aNf/FG/gs "Ruby – Try It Online")
[Answer]
# [C (clang)](http://clang.llvm.org/), ~~107~~ 105 bytes
```
Z,x,y,i,m;f(*a,z,n){for(x=z%n,Z=z/n;m=*a,y=Z,z;a+=y)for(z-=i=y+=x-->0;i--;)wmemset(a,m=a[i]<m?a[i]:m,y);}
```
[Try it online!](https://tio.run/##ZZJ9b4IwEMb/51NcSExAjsjrpqt130NClsaXpclAg7gJhs/Ori1TnKRNc/f091yPduNvvkT52fdrvGCDEgu2d6YCWyzd6/5QORfeTkpc83ZWsoKT0vA1tkx4vHGV3vpc8sbjF99fBUz6PnN/il1x2tWOwIKLTObL4l0tbwU2Luv674PcwrGSZe3QnIqqQlqhda@WSe/BsTOwXWaBqqBECRzIfdkyz5OuBfeNky3YSB5UQAHHc31ybMgV3VmWYgshS8cFclfRVtTiI8xyMrwGCCFChBAjJAgpwgvCK8IcYUGSksOOzWbpCI0MeufUBgjBX0EWaj81cmuExM8IEBONGMrGD0xyO2Gkz0YHmxss1hgJgRZozB/I1JALbWo6THVXg8vQWKSa0@5hbIzTkXFw6@SvSDJwwyQuyul@HPM/kfxSfWEmEWGC4SiOKY5GcYIpxqM4xTDRBsMTgLuvvtVRjqz/p@LnlHF7SKkaqgLVoK/a1eeqpEdldf0v "C (clang) – Try It Online")
Thanks to @ceilingcat for saving 2
]