def pad_line(line, k):
    """
    Pad a line (list of words) to length k by dividing spaces as evenly as possible, with preference given to left
    words.
    :param line: list of words
    :param k: length
    :return: a string representing the line

    >>> pad_line(['the', 'quick', 'brown'], 16)
    'the  quick brown'
    >>> pad_line(['fox', 'jumps', 'over'], 16)
    'fox  jumps  over'
    >>> pad_line(['the', 'lazy', 'dog'], 16)
    'the   lazy   dog'
    >>> pad_line(['one'], 5)
    'one  '
    """

    num_words = len(line)
    line_length = sum([len(word) for word in line])

    # Divide as evenly as possible amongst the num_words - 1 words.
    if num_words > 1:
        padding, extra_padding = divmod(k - line_length, num_words - 1)
    else:
        padding, extra_padding = k - line_length, 0

    # Now pad the line.
    padded_line = ""
    pad = ' ' * padding
    for idx, word in enumerate(line):
        # Add the word, and then the padding. If we only have one word, all padding goes to end.
        padded_line += word
        if idx < num_words - 1 or num_words == 1:
            padded_line += pad + (' ' if idx < extra_padding else '')

    return padded_line