def binary_search():
    (lo, hi) = (0, (10 ** 14))
    while ((lo + 1) < hi):
        x = ((lo + hi) // 2)
        if is_ok(x):
            hi = x
        else:
            lo = x
    return hi
def binary_search():
    (lo, hi) = (0, (10 ** 14))
    while ((lo + 1) < hi):
        x = ((lo + hi) // 2)
        if is_ok(x):
            hi = x
        else:
            lo = x
    return hi