title: Enumeration of combinations of N balls in A boxes?
body: <p>I want to enumerate all possible combinations of <strong><em>N</em></strong> balls in <strong><em>A</em></strong> boxes.</p>
  
  <p>example:
  I have <strong><em>8</em></strong> balls to deal in <strong><em>3</em></strong> boxes :</p>
  
  <pre><code>         box_1   box_2   box_3
  case-1       8       0       0
  case-2       0       8       0
  case-3       0       0       8 
  case-4       7       1       0
  case-5       7       0       1
  case-6       6       2       0
  ...
  </code></pre>
  
  <p>My first problem is that I need <strong><em>A</em></strong> loops to perform this but I want that <strong><em>A</em></strong> and <strong><em>N</em></strong> to be user's inputs. So how to do without writing all possible number of loops users could need?</p>
  
  <p><strong><em>a</em></strong> and <strong><em>N</em></strong> will be value between 2 and ~800, so it will be strongly demanding in computation time so. How to optimize that algorithm?</p>
  
  <p>I would be grateful if you answer me using python language.
  thanks for all contributions!</p>