List partition problem

hello everyone,

I would like to have a list partition like attach picture.

the logic of the partition is that first of all I compare the number in list with 8, for example 9>8, than i keep 9 .

6 and 5 is smaller than 8, so I put 6 and 5 together, 6+5>8 then i put 6 and 5 in one sublist.

the addition will stop when they once bigger than 8

how can i achieve it with grasshopper? thanks for answering

cheers

Easy way to do it is to use double loop:
Partition_by_SumLimit.gh (12.5 KB)

thanks Radovan, it is very helpful.