title: generate a 2d array of integers from given sums of its rows and columns
body: <p>I want to generate an array of integers where the total sum of each row and column in the array is known , for example if I create a 4 by 4 array in c++ and then populate it pseudo randomly with numbers between 1 and 100:</p>
  
  <pre><code>int array[4][4] = {} ;
  for(int x = 0 ; x&lt;4 ; x++){
     for(int y = 0 ; y&lt;4 ; y++){
        array[x][y] = rand() % 100 + 1 ;
     }
  }
  </code></pre>
  
  <p>the array would be : </p>
  
  <pre><code> 8, 50, 74, 59
  31, 73, 45, 79
  24, 10, 41, 66
  93, 43, 88,  4
  </code></pre>
  
  <p>then if I sum each row and each column by :</p>
  
  <pre><code>int rowSum[4] = {} ; 
  int columnSum[4] = {} ; 
  for(int x = 0 ; x &lt; 4; x++){
      for(int y = 0 ; y &lt; 4; y++){
          rowSum[x] += array[x][y] ;
          columnSum[y] += array[x][y] ;
      }
  }
  </code></pre>
  
  <p>the rowSum would be <code>{191,228,141,228}</code> and the columnSum = <code>{156,176,248,208}</code></p>
  
  <p>what I'm trying to do at this point is to generate any random 4x4 1~100 array that will satisfy <code>rowSum</code>  and <code>columnSum</code> I understand there is thousands of different arrays that will sum up to the same row and column sum ,and I've been trying to write the part of the code that will generate it , I would really appreciate it if anyone can give me a clue .    </p>