from probastat import binom
def seuil(n,p,a):
    X = binom(n,p)
    k = 0
    while X.proba_cdf(k) < 1-a:
        k = k + 1
    return k
