Skip to main content
deleted 5 characters in body
Source Link

05AB1E, 8 bytes

ô0ζO²Å0+

Try it online!

ô0ζO²Å0+   Full program
ô          Push <1st input> split into a list of <2nd input> pieces
 0ζ        Zip sublists with 0 as a filler
   O       Sum each sublist
           --- from here, the program handles with outputs shorter 
               than the required length
    ²Å0    Push a list of zeros of length <2nd input>
       +   Sum the result with that list

05AB1E, 8 bytes

ô0ζO²Å0+

Try it online!

ô0ζO²Å0+   Full program
ô          Push <1st input> split into a list of <2nd input> pieces
 0ζ        Zip sublists with 0 as a filler
   O       Sum each sublist
           --- from here, the program handles with outputs shorter 
               than the required length
    ²Å0    Push a list of zeros of length <2nd input>
       +   Sum the result with that list

05AB1E, 8 bytes

ô0ζO²Å0+

Try it online!

ô0ζO²Å0+   Full program
ô          Push <1st input> split into a list of <2nd input> pieces
 0ζ        Zip sublists with 0 as a filler
   O       Sum each sublist
           --- from here, the program handles outputs shorter 
               than the required length
    ²Å0    Push a list of zeros of length <2nd input>
       +   Sum the result with that list
Source Link

05AB1E, 8 bytes

ô0ζO²Å0+

Try it online!

ô0ζO²Å0+   Full program
ô          Push <1st input> split into a list of <2nd input> pieces
 0ζ        Zip sublists with 0 as a filler
   O       Sum each sublist
           --- from here, the program handles with outputs shorter 
               than the required length
    ²Å0    Push a list of zeros of length <2nd input>
       +   Sum the result with that list