def centered_position(text: str, width: int) ->int:
    """
    Return the integer column to start writing a string /text/ at to
    center it within a window of width /width/.

    If width is less than 1 or the text is too long for the provided width,
    AssertionError is raised.

    >>> centered_position("Soren", 11)
    4

    >>> centered_position("Maud", 10)
    4

    >>> centered_position("Soren", 10)
    3

    >>> centered_position("Using it all", 12)
    0

    >>> centered_position("Using it all.", 13)
    0

    >>> centered_position("overwraps", 2)
    Traceback (most recent call last):
      ..
    AssertionError: text 'overwraps' can't fit in 2 columns

    >>> centered_position("Soren", -8)
    Traceback (most recent call last):
      ..
    AssertionError: width must be a positive number of columns
    """
    assert width > 0, 'width must be a positive number of columns'
    assert len(text) <= width, f"text '{text}' can't fit in {width} columns"
    if len(text) == width:
        return 0
    return (width - len(text)) // 2 + 1
