import typing


def key_length(
    overflow_years: float, resolution: float, B: int
) -> typing.Tuple[int, int, float]:
    """
    Determines some key parameters for ID generation.

    Parameters
    ----------
    overflow_years : float
        Number of years after which the key length will be exceeded
    resolution : float
        Maximum length of an interval (in seconds)
    B : int
        Base of the positional notation (length of alphabet)

    Returns
    -------
    D : int
        Number of digits of the ID
    K : int
        Total number of unique IDs (intervals)
    T : float
        Duration of one interval in seconds
    """
    total_seconds = overflow_years * 31536000
    K_min = total_seconds / resolution
    D = 1
    K = B
    while K < K_min:
        D += 1
        K *= B
    T = total_seconds / K
    return D, K, T