def shortenLists(maxLength, *input_lists):
    overflows = [[] for n in input_lists]
result_lists = [[] for n in input_lists]
for i in range(len(input_lists)):
    remaining = [l for idx, l in enumerate(input_lists) if not len(
        result_lists[idx])]
shortestList = min(remaining, key=len)
idxSL = input_lists.index(shortestList)
numElems = int(math.floor(maxLength / len(remaining)))
toCopy = min(numElems, len(shortestList))
result_lists[idxSL] = shortestList[:toCopy]
if numElems < len(shortestList):
    overflows[idxSL] = shortestList[numElems:]
maxLength -= toCopy
Сократите количество списков на основе общей максимальной длины, перемещая лишнее в новые списки.