Suppose we have a simple matrix 3rows x 7cols. The matrix includes only zeros (0) and (1), such as:
1 0 1 1 1 0 0 0 0 1 1 0 0 0 0 0 1 0 1 1 0
Senario: If we know the sum of the non-zeros in each row,
(in the first line 4, in the second line - 2, in the third line - 3.) (blue line)
Additionally, if we know the sum of each col (1, 0, 3, 2, 2, 1, 0) (green line)
also if we know the sum of each diagonal from upper left to lower right (1,0,1,2,3,0,1,1,0) (red lines) counterclockwise
and finally, we know the sum of each diagonal from bottom left to top right (0,0,2,1,3,2,1,0,0) (yellow lines)

My question is: With these values โโas input (and a 3x7 matrix length),
4, 2, 3 1, 0, 3, 2, 2, 1, 0 1, 0, 1, 2, 3, 0, 1, 1, 0 0, 0, 2, 1, 3, 2, 1, 0, 0
How can we draw the first matrix? After many thoughts, I came to the conclusion that this is a linear system of equations with 3x7 unknown values โโand some equations. Right?
How can I make an algorithm in C or something else to solve these equations? Should I use a method similar to the Gausian equation?
Any help would be greatly appreciated!