code: def mr(items, targets, **kwargs):
      
      bins = [(target, []) for target in targets]
      skip = []
  
      for item in items:
          capacities = [target - sum(content) for target, content in bins]
          weighted = weight(capacities, **kwargs)
  
          (target, content), capacity, _ = max(zip(bins, capacities, weighted),
                                               key=operator.itemgetter(2))
          if item <= capacity:
              content.append(item)
          else:
              skip.append(item)
      return bins, skip
docs: Max-Rest
  
      Complexity O(n^2)