Creating Balanced Matrix help please


#1

I’ve been working on a project for well over month now and it’s about time I save myself my trouble and write this S.O.S

So, I’m trying to create a program that will create a Balanced, 2-D Matrix based on certain constraints. Here’s how it should work,

#sum of matrix item
sum_of_matrix_item = 3

#matrix values
values = [4,3,2,1,.5,.25,.125]

#loop and do some stuff
####################



#desired product
product = [ [.5,1,.125,.125,.25,1], [1,1,1], [2,1], [.5,2,.25,.25] ]...e.t.c...

The sum of each inner list is equal to the variable at the top, sum_of_matrix_item = 3