def set_val(a: np.array, i: int, x: int) -> typing.NoReturn:
    while (i < a.size):
        a[i] = max(a[i], x)
        i += (i & (- i))
def set_val(a: np.array, i: int, x: int) -> typing.NoReturn:
    while (i < a.size):
        a[i] = max(a[i], x)
        i += (i & (- i))