def split_list(n,ls):
    """Split input list into n chunks, remainder of division by n goes into last chunk.
    If input list is empty, returns list of n empty lists.
    Parameters
    ----------
    n : int
        Number of chunks.
    ls : list
        List to split.
    Returns
    -------
    list
        List of n chunks of input list.
    """
    if len(ls) == 0:
        return [[] for i in range(n)]
    m = int(len(ls)/n)
    chunks = []
    for i in range(0,len(ls),m):
        if i == (n - 1)*m:
            chunks.append(ls[i:])
            break
        chunks.append(ls[i:(i + m)])
    return chunks