def calculate_widths(parts, num=12):
    """
    Generates a list of length parts containing integers, the sum of which is num.
    """
    first = num // parts
    last = num - (parts - 1) * first
    return (parts - 1) * [first] + [last]
