Distribute ``N`` into ``k`` parts such that each part
    takes the value ``N//k`` or ``N//k + 1`` where ``//`` denotes integer
    division; i.e., perform the minimal lexicographic integer partition.

    Example: N = 5, k = 2  -->  return [3, 2]

def partition(N, k):
    '''Distribute ``N`` into ``k`` parts such that each part
    takes the value ``N//k`` or ``N//k + 1`` where ``//`` denotes integer
    division; i.e., perform the minimal lexicographic integer partition.

    Example: N = 5, k = 2  -->  return [3, 2]

    '''
    out = [N // k] * k
    remainder = N % k
    for i in range(remainder):
        out[i] += 1
    return out