title: Algorithm for distributing a number between certain number of chunks
body: <p>I am looking for an algorithm to split up a number between a certain number of the chunk.
  The real example is: assigning initial capacity to all the workers based on the total number of tasks.</p>
  
  <p>e.g If there are 3 persons and 6 tasks. Each will have an initial capacity 
           <code>= 6 / 3 = 2</code></p>
  
  <p>I come up with an implementation. But, I am not sure it is an optimal way to achieve it. </p>
  
  <pre><code>def capacity_distribution(task_size, people_size):
      """
      It distributes initial capacity to each person.
      """
      div = task_size // people_size
  
      remainder = task_size % people_size
  
      first_chunk_size = people_size - remainder
      second_chunk_size = people_size - first_chunk_size
  
      first_capacity_list = []
      second_capacity_list = []
      first_capacity_list = [div for _ in range(first_chunk_size)]
      second_capacity_list = [div + 1 for _ in range(second_chunk_size)]
      first_capacity_list.extend(second_capacity_list)
  
      return first_capacity_list
  
  
  
  print(capacity_distribution(6, 2))
  print(capacity_distribution(7, 3))
  print(capacity_distribution(11, 3))
  print(capacity_distribution(18, 5))
  </code></pre>
  
  <p>Output :</p>
  
  <pre><code>[3, 3]
  [2, 2, 3]
  [3, 4, 4]
  [3, 3, 4, 4, 4]
  </code></pre>
  
  <p>Is there any other efficient way for this one?</p>