import math


def obrien_fleming_cutoff(K, current_k, alpha):
    """ Returns the cutoff value for O'Brien and Fleming's Test

    Arguments:
        K: An integer less than 10.
        current_k: The current interm analysis number
        alpha: The alpha level of the overall trial (0.01, 0.05 or 0.1).

    Returns:
        cutoff: The value of \(C_B(K, \alpha)\) for the study.

    Note:
        Since there is no closed source formula for the cutoff value, a lookup
        table is used.
    """

    if not isinstance(K, int) or K < 1 or K > 10:
        raise ValueError('K must be an integer between 1 and 10.')

    if not isinstance(current_k, int) or current_k < 1 or current_k > 10:
        raise ValueError('current_k must be an integer between 1 and 10.')
    if current_k > K:
        raise ValueError('current_k must be less than k.')

    if alpha not in [0.01, 0.05, 0.1]:
        raise ValueError('alpha must be 0.01, 0.05, or 0.1.')

    cutoffs = {
        "0.01": [2.576, 2.580, 2.595, 2.939, 2.986, 3.023, 3.053, 3.078, 3.099, 3.117],
        "0.05": [1.960, 2.178, 2.289, 2.361, 2.413, 2.453, 2.485, 2.512, 2.535, 2.555],
        "0.1": [1.645, 1.875, 1.992, 2.067, 2.122, 2.164, 2.197, 2.225, 2.249, 2.270],
    }
    return cutoffs[str(alpha)][K - 1] * math.sqrt(K / current_k)