code: def mkCuttingStock(s):
      
      w,q = [],[]   # list of different widths (sizes) of items, their quantities
      for item in sorted(s):
          if w == [] or item != w[-1]:
              w.append(item)
              q.append(1)
          else:
              q[-1] += 1
      return w,q
docs: mkCuttingStock: convert a bin packing instance into cutting stock format