def _min_part(n, w):
    """Helper function for fixed_lex_partitions. Returns a tuple containing:
        1) The output of minimal_partition(n,L)
        2) #(Occurances of 1 in this partition)+1.

    The second output is returned so as to avoid calling the count() method of
    the list corresponding to the partition, since this information is
    necessarily contained in the process of its creation. It is needed by
    fixed_lexed_partitions for the index on which to decrement."""
    binsize = n//w
    overstuffed = n - w*binsize
    regular = w - overstuffed
    ones_count = 0 if binsize != 1 else regular
    return [binsize+1]*overstuffed + [binsize]*regular, ones_count