title: how to distribute items in number of lists?
body: <p><strong>Question:</strong> How to distribute items in number of lists? following are examples:</p>
  
  <ul>
  <li><p>Imagine I have a 8 lists, and 5 items. in this case list 1 to 5 will have 1 item.  rest of lists remain empty.</p></li>
  <li><p>Now If I have 8 lists and 16 items each list will have 2 items.</p></li>
  <li><p>If I have 8 lists and 11 items, list 1 to 3 will have two items. rest of the lists will have 1 item.</p></li>
  </ul>
  
  <hr>
  
  <pre><code>var items = new List&lt;object&gt;();
  var containers = new List&lt;List&lt;object&gt;&gt;();
  
  int c = -1; // indexer for container.
  
  for(int i = 0; i &lt; items.Count; i++)
  {
      // disturbute items to containers
  
      if (i % (items.Count/containers.Count) == 0) c++; // this is wrong. when to increment?
  
      containers[c].Add(items[i]);
  }
  </code></pre>
  
  <p>I'm pretty sure only if statement is wrong. Its getting confusing how to handle <code>i</code>.</p>